| OLD | NEW |
| 1 /* | 1 /* |
| 2 ****************************************************************************** | 2 ****************************************************************************** |
| 3 * | 3 * |
| 4 * Copyright (C) 1997-2014, International Business Machines | 4 * Copyright (C) 1997-2015, International Business Machines |
| 5 * Corporation and others. All Rights Reserved. | 5 * Corporation and others. All Rights Reserved. |
| 6 * | 6 * |
| 7 ****************************************************************************** | 7 ****************************************************************************** |
| 8 * | 8 * |
| 9 * File umutex.cpp | 9 * File umutex.cpp |
| 10 * | 10 * |
| 11 * Modification History: | 11 * Modification History: |
| 12 * | 12 * |
| 13 * Date Name Description | 13 * Date Name Description |
| 14 * 04/02/97 aliu Creation. | 14 * 04/02/97 aliu Creation. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 do { | 89 do { |
| 90 Sleep(1); | 90 Sleep(1); |
| 91 previousState = umtx_loadAcquire(uio.fState); | 91 previousState = umtx_loadAcquire(uio.fState); |
| 92 } while (previousState == 1); | 92 } while (previousState == 1); |
| 93 } | 93 } |
| 94 } | 94 } |
| 95 } | 95 } |
| 96 | 96 |
| 97 // This function is called by the thread that ran an initialization function, | 97 // This function is called by the thread that ran an initialization function, |
| 98 // just after completing the function. | 98 // just after completing the function. |
| 99 // | |
| 100 // success: True: the inialization succeeded. No further calls to the init | |
| 101 // function will be made. | |
| 102 // False: the initializtion failed. The next call to umtx_initOnce() | |
| 103 // will retry the initialization. | |
| 104 | 99 |
| 105 U_COMMON_API void U_EXPORT2 umtx_initImplPostInit(UInitOnce &uio) { | 100 U_COMMON_API void U_EXPORT2 umtx_initImplPostInit(UInitOnce &uio) { |
| 106 umtx_storeRelease(uio.fState, 2); | 101 umtx_storeRelease(uio.fState, 2); |
| 107 } | 102 } |
| 108 | 103 |
| 109 U_NAMESPACE_END | 104 U_NAMESPACE_END |
| 110 | 105 |
| 111 static void winMutexInit(CRITICAL_SECTION *cs) { | 106 static void winMutexInit(CRITICAL_SECTION *cs) { |
| 112 InitializeCriticalSection(cs); | 107 InitializeCriticalSection(cs); |
| 113 return; | 108 return; |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 | 378 |
| 384 | 379 |
| 385 U_DEPRECATED void U_EXPORT2 | 380 U_DEPRECATED void U_EXPORT2 |
| 386 u_setAtomicIncDecFunctions(const void * /*context */, UMtxAtomicFn *, UMtxAtomic
Fn *, | 381 u_setAtomicIncDecFunctions(const void * /*context */, UMtxAtomicFn *, UMtxAtomic
Fn *, |
| 387 UErrorCode *status) { | 382 UErrorCode *status) { |
| 388 if (U_SUCCESS(*status)) { | 383 if (U_SUCCESS(*status)) { |
| 389 *status = U_UNSUPPORTED_ERROR; | 384 *status = U_UNSUPPORTED_ERROR; |
| 390 } | 385 } |
| 391 return; | 386 return; |
| 392 } | 387 } |
| OLD | NEW |