added: to thread manager: names of the threads

the names are shown in the log file


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@837 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2012-05-19 17:04:33 +00:00
parent 0df088e1e2
commit db9d381a43
6 changed files with 55 additions and 19 deletions

View File

@@ -2,7 +2,7 @@
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2011, Tomasz Sowa
* Copyright (c) 2011-2012, Tomasz Sowa
* All rights reserved.
*
*/
@@ -10,6 +10,7 @@
#ifndef headerfile_winix_core_threadmanager
#define headerfile_winix_core_threadmanager
#include <string>
#include <vector>
#include "basethread.h"
#include "synchro.h"
@@ -31,7 +32,10 @@ public:
// adding a new thread to the queue
// the thread will be running only if we call StartAll() before
// otherwise the thread will be waiting for StartAll()
void Add(BaseThread * pbase);
void Add(BaseThread * pbase, const wchar_t * thread_name);
void Add(BaseThread & pbase, const wchar_t * thread_name);
void Add(BaseThread * pbase, const std::wstring & thread_name);
void Add(BaseThread & pbase, const std::wstring & thread_name);
// starting all threads
void StartAll();
@@ -42,8 +46,14 @@ public:
private:
struct ThreadItem
{
BaseThread * object;
std::wstring name;
};
Synchro * synchro;
typedef std::vector<BaseThread*> ThreadTab;
typedef std::vector<ThreadItem> ThreadTab;
ThreadTab thread_tab;
bool were_started;