X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_once.c;h=a8f8aeb17a03995cba0ac62d75cd2d97d09ff0dc;hb=733d1ea759119bcd0554f25034d1b4113b910900;hp=df655ef9a4c8850594e9fbbfe4b0d34ff1821890;hpb=dc95322e18615392eea69de355edd735a15a8f36;p=musl diff --git a/src/thread/pthread_once.c b/src/thread/pthread_once.c index df655ef9..a8f8aeb1 100644 --- a/src/thread/pthread_once.c +++ b/src/thread/pthread_once.c @@ -40,7 +40,7 @@ int __pthread_once(pthread_once_t *control, void (*init)(void)) { /* Return immediately if init finished before, but ensure that * effects of the init routine are visible to the caller. */ - if (*control == 2) { + if (*(volatile int *)control == 2) { a_barrier(); return 0; }