| 899 | |
| 900 | #if mxThreads |
| 901 | void fxWaitSharedChunkCallback(void* timer, void* refcon, txInteger refconSize) |
| 902 | { |
| 903 | txSharedWaiter** address = (txSharedWaiter**)refcon; |
| 904 | txSharedWaiter* waiter = *address; |
| 905 | txSharedWaiter* link; |
| 906 | txMachine* the; |
| 907 | mxLockMutex(&gxSharedCluster->waiterMutex); |
| 908 | address = &(gxSharedCluster->first); |
| 909 | while ((link = *address)) { |
| 910 | if (link == waiter) |
| 911 | *address = link->next; |
| 912 | else |
| 913 | address = &(link->next); |
| 914 | } |
| 915 | mxUnlockMutex(&gxSharedCluster->waiterMutex); |
| 916 | the = waiter->the; |
| 917 | fxBeginHost(waiter->the); |
| 918 | mxTry(the) { |
| 919 | mxPushUndefined(); |
| 920 | mxPush(waiter->resolve); |
| 921 | mxCall(); |
| 922 | if (waiter->ok) |
| 923 | mxPushStringX("ok"); |
| 924 | else |
| 925 | mxPushStringX("timed-out"); |
| 926 | mxRunCount(1); |
| 927 | mxPop(); |
| 928 | } |
| 929 | mxCatch(the) { |
| 930 | } |
| 931 | fxForget(the, &waiter->resolve); |
| 932 | fxEndHost(the); |
| 933 | c_free(waiter); |
| 934 | } |
| 935 | #endif |
| 936 | |
| 937 | txInteger fxWaitSharedChunk(txMachine* the, void* data, txNumber timeout, txSlot* resolveFunction) |
nothing calls this directly
no test coverage detected