Changeset 1126 in webkit for trunk/JavaScriptCore/kjs/ustring.cpp
- Timestamp:
- May 10, 2002, 9:41:01 AM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/ustring.cpp
r1024 r1126 122 122 UString::Rep UString::Rep::null = { 0, 0, 1 }; 123 123 UString UString::null; 124 #ifdef APPLE_CHANGES 125 // FIXME: fix this once static initializers for pthread_once_t 126 pthread_once_t statBufferKeyOnce = {_PTHREAD_ONCE_SIG_init, {}}; 127 pthread_key_t statBufferKey; 128 #else 124 129 static char *statBuffer = 0L; 130 #endif 125 131 126 132 UChar::UChar(const UCharReference &c) … … 278 284 } 279 285 286 #ifdef APPLE_CHANGES 287 static void statBufferKeyCleanup(void *statBuffer) 288 { 289 if (statBuffer != NULL) 290 delete [] (char *)statBuffer; 291 } 292 293 static void statBufferKeyInit(void) 294 { 295 pthread_key_create(&statBufferKey, statBufferKeyCleanup); 296 } 297 #endif 298 280 299 char *UString::ascii() const 281 300 { 301 #ifdef APPLE_CHANGES 302 pthread_once(&statBufferKeyOnce, statBufferKeyInit); 303 char *statBuffer = (char *)pthread_getspecific(statBufferKey); 304 #endif 282 305 if (statBuffer) 283 306 delete [] statBuffer; … … 288 311 statBuffer[size()] = '\0'; 289 312 313 #ifdef APPLE_CHANGES 314 pthread_setspecific(statBufferKey, statBuffer); 315 #endif 290 316 return statBuffer; 291 317 }
Note:
See TracChangeset
for help on using the changeset viewer.