Changeset 13653 in vbox for trunk/src/VBox/Runtime/r3/posix
- Timestamp:
- Oct 29, 2008 2:28:27 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp
r8245 r13653 61 61 static void *rtThreadNativeMain(void *pvArgs); 62 62 static void rtThreadKeyDestruct(void *pvValue); 63 63 static void rtThreadPosixPokeSignal(int iSignal); 64 64 65 65 int rtThreadNativeInit(void) … … 69 69 * a threads RTTHREADINT structure. 70 70 */ 71 72 71 int rc = pthread_key_create(&g_SelfKey, rtThreadKeyDestruct); 73 if (!rc) 74 return VINF_SUCCESS; 75 return VERR_NO_TLS_FOR_SELF; 72 if (rc) 73 return VERR_NO_TLS_FOR_SELF; 74 75 /* 76 * Register the dummy signal handler for RTThreadPoke. 77 */ 78 void (*pfnOld)(int); 79 pfnOld = signal(SIGUSR2, rtThreadPosixPokeSignal); 80 Assert(pfnOld == SIG_DFL); 81 return rc; 76 82 } 77 83 … … 93 99 pthread_setspecific(g_SelfKey, NULL); 94 100 } 101 } 102 103 104 /** 105 * Dummy signal handler for the poke signal. 106 * 107 * @param iSignal The signal number. 108 */ 109 static void rtThreadPosixPokeSignal(int iSignal) 110 { 111 Assert(iSignal == SIGUSR2); 112 NOREF(iSignal); 95 113 } 96 114 … … 277 295 } 278 296 297 298 RTDECL(int) RTThreadPoke(RTTHREAD hThread) 299 { 300 AssertReturn(hThread != RTThreadSelf(), VERR_INVALID_PARAMETER); 301 PRTTHREADINT pThread = rtThreadGet(hThread); 302 AssertReturn(pThread, VERR_INVALID_HANDLE); 303 304 int rc = pthread_kill((pthread_t)(uintptr_t)pThread->Core.Key, SIGUSR2); 305 306 rtThreadRelease(pThread); 307 return RTErrConvertFromErrno(rc); 308 }
Note:
See TracChangeset
for help on using the changeset viewer.