MCPcopy Create free account
hub / github.com/apache/impala / GoogleOnceInitArg

Function GoogleOnceInitArg

be/src/gutil/once.h:63–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61// of arbitrary type.
62template<typename T>
63inline void GoogleOnceInitArg(GoogleOnceType* state,
64 void (*func_with_arg)(T*), T* arg) {
65 Atomic32 s = Acquire_Load(&state->state);
66 if (PREDICT_FALSE(s != GOOGLE_ONCE_INTERNAL_DONE)) {
67 // Deal with const T as well as non-const T.
68 typedef typename base::remove_const<T>::type mutable_T;
69 GoogleOnceInternalInit(&state->state, 0,
70 reinterpret_cast<void(*)(void*)>(func_with_arg),
71 const_cast<mutable_T*>(arg));
72 }
73 ANNOTATE_HAPPENS_AFTER(&state->state);
74}
75
76// GoogleOnceDynamic is like GoogleOnceType, but is dynamically
77// initialized instead of statically initialized. This should be used only

Callers

nothing calls this directly

Calls 2

GoogleOnceInternalInitFunction · 0.85
Acquire_LoadFunction · 0.70

Tested by

no test coverage detected