MCPcopy Create free account
hub / github.com/Inori/GPCS4 / __pthread_get_pointer

Function __pthread_get_pointer

3rdParty/winpthreads/src/thread.c:127–154  ·  view source on GitHub ↗

Search the list idList for an element with identifier ID. If found, its associated _pthread_v pointer is returned, otherwise NULL. NOTE: This method is not locked. */

Source from the content-addressed store, hash-verified

125 NULL.
126 NOTE: This method is not locked. */
127static struct _pthread_v *
128__pthread_get_pointer (pthread_t id)
129{
130 size_t l, r, p;
131 if (!idListCnt)
132 return NULL;
133 if (idListCnt == 1)
134 return (idList[0].id == id ? idList[0].ptr : NULL);
135 l = 0; r = idListCnt - 1;
136 while (l <= r)
137 {
138 p = (l + r) >> 1;
139 if (idList[p].id == id)
140 return idList[p].ptr;
141 else if (idList[p].id > id)
142 {
143 if (p == l)
144 return NULL;
145 r = p - 1;
146 }
147 else
148 {
149 l = p + 1;
150 }
151 }
152
153 return NULL;
154}
155
156static void
157__pth_remove_use_for_key (pthread_key_t key)

Callers 4

__pth_gpointer_lockedFunction · 0.85
pthread_killFunction · 0.85
_pthread_tryjoinFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected