Changeset 6944 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Feb 14, 2008 12:46:56 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 28109
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/os2/thread-os2.cpp
r5999 r6944 39 39 #include <signal.h> 40 40 #include <InnoTekLIBC/FastInfoBlocks.h> 41 #include <InnoTekLIBC/thread.h> 41 42 42 43 #include <iprt/thread.h> … … 220 221 } 221 222 223 224 RTR3DECL(int) RTTlsAlloc(void) 225 { 226 AssertCompile(NIL_RTTLS == -1); 227 return __libc_TLSAlloc(); 228 } 229 230 231 RTR3DECL(int) RTTlsAllocEx(PRTTLS piTls) 232 { 233 int iTls = __libc_TLSAlloc(); 234 if (iTls != -1) 235 return iTls; 236 return RTErrConvertFromErrno(errno); 237 } 238 239 240 RTR3DECL(int) RTTlsFree(RTTLS iTls) 241 { 242 if (iTls == NIL_RTTLS) 243 return VINF_SUCCESS; 244 if (__libc_TLSFree(iTls) != -1) 245 return VINF_SUCCESS; 246 return RTErrConvertFromErrno(errno); 247 } 248 249 250 RTR3DECL(void *) RTTlsGet(RTTLS iTls) 251 { 252 return __libc_TLSGet(iTls); 253 } 254 255 256 RTR3DECL(int) RTTlsGetEx(RTTLS iTls, void **ppvValue) 257 { 258 int rc = VINF_SUCCESS; 259 void *pv = __libc_TLSGet(iTls); 260 if (RT_UNLIKELY(!pv)) 261 { 262 errno = 0; 263 pv = __libc_TLSGet(iTls); 264 if (!pv && errno) 265 rc = RTErrConvertFromErrno(errno); 266 } 267 268 *ppvValue = pv; 269 return rc; 270 } 271 272 273 RTR3DECL(int) RTTlsSet(RTTLS iTls, void *pvValue) 274 { 275 if (__libc_TLSSet(iTls, pvValue) != -1) 276 return VINF_SUCCESS; 277 return RTErrConvertFromErrno(errno); 278 } 279 280 281 RTR3DECL(int) RTTlsSetDestructor(RTTLS iTls, PFNRTTLSDTOR pfnDestructor, uint32_t fFlags) 282 { 283 AssertReturn(!fFlags, VERR_INVALID_PARAMETER) 284 if (__libc_TLSDestructor(iTls, pfnDestructor, fFlags) == -1) 285 return VINF_SUCCESS; 286 return RTErrConvertFromErrno(errno); 287 } 288 289 290 PFNRTTLSDTOR RTTlsGetDestructor(RTTLS iTls, PFNRTTLSDTOR *ppfnDestructor, uint32_t *pfFlags) 291 { 292 uint32_t fFlags; 293 if (!pfFlags) 294 pfFlags = &fFlags; 295 errno = 0; 296 *ppfnDestructor = __libc_TLSGetDestructor(iTls, pFlags); 297 if (!*ppfnDestructor && errno) 298 return RTErrConvertFromErrno(errno); 299 return VINF_SUCCESS; 300 } 301
Note:
See TracChangeset
for help on using the changeset viewer.