Begin work to remove use of thread cancellation for NaCl

This commit is contained in:
Cameron Gutman
2016-02-15 15:58:42 -05:00
parent b2be459ff3
commit d7f40ec39b
9 changed files with 103 additions and 76 deletions

View File

@@ -5,11 +5,6 @@
typedef void(*ThreadEntry)(void* context);
struct thread_context {
ThreadEntry entry;
void* context;
};
#if defined(LC_WINDOWS)
typedef struct _PLT_THREAD {
HANDLE handle;
@@ -22,12 +17,18 @@ typedef struct _PLT_THREAD {
typedef HANDLE PLT_MUTEX;
typedef HANDLE PLT_EVENT;
#elif defined (LC_POSIX)
typedef pthread_t PLT_THREAD;
typedef struct _PLT_THREAD {
pthread_t thread;
int cancelled;
struct _PLT_THREAD* next;
} PLT_THREAD;
typedef pthread_mutex_t PLT_MUTEX;
typedef struct _PLT_EVENT {
pthread_mutex_t mutex;
pthread_cond_t cond;
int signalled;
int cancelled;
} PLT_EVENT;
#else
#error Unsupported platform