Category : OS/2 Files
Archive   : EMXLIB8F.ZIP
Filename : STARTUP2.C

 
Output of file : STARTUP2.C contained in archive : EMXLIB8F.ZIP
/* startup2.c (emx+gcc) -- Copyright (c) 1993 by Eberhard Mattes */

#include
#define INCL_DOSSEMAPHORES
#define INCL_DOSEXCEPTIONS
#define INCL_DOSPROCESS
#define INCL_DOSERRORS
#include

static HMTX _heap_mutex;


void _startup_emxlibc_dll (void)
{
ULONG rc;

rc = DosCreateMutexSem (NULL, &_heap_mutex, 0, FALSE);
if (rc != 0)
DosBeep (466, 500);
}


void _heap_lock (void)
{
ULONG nesting, rc;

DosEnterMustComplete (&nesting);
do
{
rc = DosRequestMutexSem (_heap_mutex, SEM_INDEFINITE_WAIT);
} while (rc == ERROR_SEM_OWNER_DIED);
if (rc != 0)
DosBeep (466, 500);
}

void _heap_unlock (void)
{
ULONG nesting;

DosReleaseMutexSem (_heap_mutex);
DosExitMustComplete (&nesting);
}


  3 Responses to “Category : OS/2 Files
Archive   : EMXLIB8F.ZIP
Filename : STARTUP2.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/