/*
    smutex.c

    Copyright (C) 1995,1996
	Rainer Schnitker, Heeper Str. 283, 33607 Bielefeld
	email: rainer@mathematik.uni-bielefeld.de

    All rights reserved
*/

#include <emx/syscalls.h>
#include <sys/builtin.h>
#include <sys/smutex.h>

#define WIN32_LEAN_AND_MEAN
#include <wingnuc.h>
#include <windows.h>

/****************************************************************************/
/*	    REPLACE \emx\src\lib\process\fmutex.c			    */
/****************************************************************************/

void __rsxntfix_smutex_request_internal (volatile _smutex *sem)
{
  do
    {
      Sleep (1);
    } while (__cxchg (sem, 1) != 0);
}
