Merge pull request #422 from MaddTheSane/patch-2

Update rthreads.c
This commit is contained in:
zeromus 2021-01-25 17:18:34 -05:00 committed by GitHub
commit 0942fb5c5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -75,7 +75,7 @@ struct sthread
{ {
#ifdef USE_WIN32_THREADS #ifdef USE_WIN32_THREADS
HANDLE thread; HANDLE thread;
DWORD thread_id; DWORD thread_id;
#else #else
pthread_t id; pthread_t id;
#endif #endif
@ -194,7 +194,7 @@ sthread_t *sthread_create_with_priority(void (*thread_func)(void*), void *userda
data->userdata = userdata; data->userdata = userdata;
#ifdef USE_WIN32_THREADS #ifdef USE_WIN32_THREADS
thread->thread = CreateThread(NULL, 0, thread_wrap, data, 0, &thread->thread_id); thread->thread = CreateThread(NULL, 0, thread_wrap, data, 0, &thread->thread_id);
thread_created = !!thread->thread; thread_created = !!thread->thread;
#else #else
pthread_attr_t thread_attr; pthread_attr_t thread_attr;
@ -314,8 +314,8 @@ void sthread_setname(sthread_t *thread, const char *name)
{ {
if (!thread) if (!thread)
return; return;
// TODO: implement that for Windows too. // TODO: implement that for Windows (and Mac?) too.
#ifndef USE_WIN32_THREADS #if !defined(USE_WIN32_THREADS) && !defined(__APPLE__)
pthread_setname_np(thread->id, name); pthread_setname_np(thread->id, name);
#endif #endif
} }