| 61 | // of arbitrary type. |
| 62 | template<typename T> |
| 63 | inline 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 |
nothing calls this directly
no test coverage detected