home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 June
/
SIMTEL_0692.cdr
/
msdos
/
desqview
/
dvglue10.arc
/
TVMALLOC.C
< prev
next >
Wrap
C/C++ Source or Header
|
1988-07-10
|
1KB
|
39 lines
/*================================================*/
/* TVMALLOC.C */
/* */
/* (c) Copyright 1988 Ralf Brown */
/* All Rights Reserved */
/* May be freely copied for noncommercial use as */
/* long as this copyright notice is kept intact */
/* and any changes are indicated in the comment */
/* blocks for the functions */
/*================================================*/
#include "tvapi.h"
#undef malloc
/*================================================*/
extern OBJECT _TV_alloc_mutex_ ;
/*================================================*/
/* _TV_malloc version of malloc which is safe in */
/* the presence of multiple threads */
/* Ralf Brown 5/10/88 */
/*================================================*/
void *_TV_malloc(size_t size)
{
void *retval ;
if (!TVisobj(_TV_alloc_mutex_))
_TV_alloc_mutex_ = TVmbx_new() ;
TVlock(_TV_alloc_mutex_) ;
retval = malloc(size) ;
TVunlock(_TV_alloc_mutex_) ;
return retval ;
}
/* End of TVMALLOC.C */