MCPcopy Create free account
hub / github.com/alibaba/PhotonLibOS / st_key_create

Function st_key_create

thread/st.cpp:96–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96int st_key_create(int *keyp, void (*destructor)(void *)) {
97 photon::thread_key_t key;
98 auto ret = photon::thread_key_create(&key, destructor);
99 if (ret < 0)
100 LOG_ERRNO_RETURN(0, -1, "failed to thread_key_create()");
101 if (key > INT_MAX) {
102 photon::thread_key_delete(key);
103 LOG_ERROR_RETURN(EOVERFLOW, -1, "thread key space overflow");
104 }
105 *keyp = key;
106 return 0;
107}
108
109int st_key_getlimit(void) {
110 return photon::THREAD_KEYS_MAX;

Callers

nothing calls this directly

Calls 2

thread_key_createFunction · 0.85
thread_key_deleteFunction · 0.85

Tested by

no test coverage detected