- now the mess with threads has gone away
- we have a class BaseThread -- this is a base class -- we can inherit from it when creating a new thread - others treads are correctly stopped (when signal comes) -- pthread_join - we have a special thread only for signals git-svn-id: svn://ttmath.org/publicrep/winix/trunk@685 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
36
core/synchro.h
Executable file
36
core/synchro.h
Executable file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2010, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoresynchro
|
||||
#define headerfilecmslucoresynchro
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
|
||||
|
||||
struct Synchro
|
||||
{
|
||||
// one global mutex
|
||||
pthread_mutex_t mutex;
|
||||
|
||||
|
||||
// true when winix is closing
|
||||
volatile bool was_stop_signal;
|
||||
|
||||
|
||||
Synchro();
|
||||
|
||||
bool Lock();
|
||||
void Unlock();
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user