aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/support/sync_windows.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lib/support/sync_windows.cc')
-rw-r--r--src/core/lib/support/sync_windows.cc28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/core/lib/support/sync_windows.cc b/src/core/lib/support/sync_windows.cc
index 62fdd40af7..7cd41633d5 100644
--- a/src/core/lib/support/sync_windows.cc
+++ b/src/core/lib/support/sync_windows.cc
@@ -26,25 +26,25 @@
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
-void gpr_mu_init(gpr_mu *mu) {
+void gpr_mu_init(gpr_mu* mu) {
InitializeCriticalSection(&mu->cs);
mu->locked = 0;
}
-void gpr_mu_destroy(gpr_mu *mu) { DeleteCriticalSection(&mu->cs); }
+void gpr_mu_destroy(gpr_mu* mu) { DeleteCriticalSection(&mu->cs); }
-void gpr_mu_lock(gpr_mu *mu) {
+void gpr_mu_lock(gpr_mu* mu) {
EnterCriticalSection(&mu->cs);
GPR_ASSERT(!mu->locked);
mu->locked = 1;
}
-void gpr_mu_unlock(gpr_mu *mu) {
+void gpr_mu_unlock(gpr_mu* mu) {
mu->locked = 0;
LeaveCriticalSection(&mu->cs);
}
-int gpr_mu_trylock(gpr_mu *mu) {
+int gpr_mu_trylock(gpr_mu* mu) {
int result = TryEnterCriticalSection(&mu->cs);
if (result) {
if (mu->locked) { /* This thread already holds the lock. */
@@ -58,13 +58,13 @@ int gpr_mu_trylock(gpr_mu *mu) {
/*----------------------------------------*/
-void gpr_cv_init(gpr_cv *cv) { InitializeConditionVariable(cv); }
+void gpr_cv_init(gpr_cv* cv) { InitializeConditionVariable(cv); }
-void gpr_cv_destroy(gpr_cv *cv) {
+void gpr_cv_destroy(gpr_cv* cv) {
/* Condition variables don't need destruction in Win32. */
}
-int gpr_cv_wait(gpr_cv *cv, gpr_mu *mu, gpr_timespec abs_deadline) {
+int gpr_cv_wait(gpr_cv* cv, gpr_mu* mu, gpr_timespec abs_deadline) {
int timeout = 0;
DWORD timeout_max_ms;
mu->locked = 0;
@@ -93,23 +93,23 @@ int gpr_cv_wait(gpr_cv *cv, gpr_mu *mu, gpr_timespec abs_deadline) {
return timeout;
}
-void gpr_cv_signal(gpr_cv *cv) { WakeConditionVariable(cv); }
+void gpr_cv_signal(gpr_cv* cv) { WakeConditionVariable(cv); }
-void gpr_cv_broadcast(gpr_cv *cv) { WakeAllConditionVariable(cv); }
+void gpr_cv_broadcast(gpr_cv* cv) { WakeAllConditionVariable(cv); }
/*----------------------------------------*/
-static void *dummy;
+static void* dummy;
struct run_once_func_arg {
void (*init_function)(void);
};
-static BOOL CALLBACK run_once_func(gpr_once *once, void *v, void **pv) {
- struct run_once_func_arg *arg = (struct run_once_func_arg *)v;
+static BOOL CALLBACK run_once_func(gpr_once* once, void* v, void** pv) {
+ struct run_once_func_arg* arg = (struct run_once_func_arg*)v;
(*arg->init_function)();
return 1;
}
-void gpr_once_init(gpr_once *once, void (*init_function)(void)) {
+void gpr_once_init(gpr_once* once, void (*init_function)(void)) {
struct run_once_func_arg arg;
arg.init_function = init_function;
InitOnceExecuteOnce(once, run_once_func, &arg, &dummy);