Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1324)

Unified Diff: source/common/umutex.h

Issue 845603002: Update ICU to 54.1 step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@master
Patch Set: remove unusued directories Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/common/ulocimp.h ('k') | source/common/umutex.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/common/umutex.h
diff --git a/source/common/umutex.h b/source/common/umutex.h
index dba63b6ecf6bdcff111b9b4e8dde1f664bf36098..e0ad0d3c03654d61a023a082548563d8d4c03c61 100644
--- a/source/common/umutex.h
+++ b/source/common/umutex.h
@@ -1,6 +1,6 @@
/*
**********************************************************************
-* Copyright (C) 1997-2013, International Business Machines
+* Copyright (C) 1997-2014, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
*
@@ -27,6 +27,7 @@
// Forward Declarations. UMutex is not in the ICU namespace (yet) because
// there are some remaining references from plain C.
struct UMutex;
+struct UConditionVar;
U_NAMESPACE_BEGIN
struct UInitOnce;
@@ -320,7 +321,7 @@ U_NAMESPACE_END
typedef struct UMutex {
- icu::UInitOnce fInitOnce;
+ icu::UInitOnce fInitOnce;
CRITICAL_SECTION fCS;
} UMutex;
@@ -329,6 +330,14 @@ typedef struct UMutex {
*/
#define U_MUTEX_INITIALIZER {U_INITONCE_INITIALIZER}
+struct UConditionVar {
+ HANDLE fEntryGate;
+ HANDLE fExitGate;
+ int32_t fWaitCount;
+};
+
+#define U_CONDITION_INITIALIZER {NULL, NULL, 0}
+
#elif U_PLATFORM_IMPLEMENTS_POSIX
@@ -345,6 +354,11 @@ struct UMutex {
typedef struct UMutex UMutex;
#define U_MUTEX_INITIALIZER {PTHREAD_MUTEX_INITIALIZER}
+struct UConditionVar {
+ pthread_cond_t fCondition;
+};
+#define U_CONDITION_INITIALIZER {PTHREAD_COND_INITIALIZER}
+
#else
/*
@@ -379,5 +393,32 @@ U_INTERNAL void U_EXPORT2 umtx_lock(UMutex* mutex);
*/
U_INTERNAL void U_EXPORT2 umtx_unlock (UMutex* mutex);
+/*
+ * Wait on a condition variable.
+ * The calling thread will unlock the mutex and wait on the condition variable.
+ * The mutex must be locked by the calling thread when invoking this function.
+ *
+ * @param cond the condition variable to wait on.
+ * @param mutex the associated mutex.
+ */
+
+U_INTERNAL void U_EXPORT2 umtx_condWait(UConditionVar *cond, UMutex *mutex);
+
+
+/*
+ * Broadcast wakeup of all threads waiting on a Condition.
+ * The associated mutex must be locked by the calling thread when calling
+ * this function; this is a temporary ICU restriction.
+ *
+ * @param cond the condition variable.
+ */
+U_INTERNAL void U_EXPORT2 umtx_condBroadcast(UConditionVar *cond);
+
+/*
+ * Signal a condition variable, waking up one waiting thread.
+ * CAUTION: Do not use. Place holder only. Not implemented for Windows.
+ */
+U_INTERNAL void U_EXPORT2 umtx_condSignal(UConditionVar *cond);
+
#endif /* UMUTEX_H */
/*eof*/
« no previous file with comments | « source/common/ulocimp.h ('k') | source/common/umutex.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698