removed getcallerpc dependency, we have no threads, thus no locking needed

This commit is contained in:
Anselm R. Garbe
2006-01-23 17:36:21 +02:00
parent a106699167
commit bebc443496
3 changed files with 41 additions and 6 deletions

View File

@@ -19,6 +19,12 @@ TARG=lib9
# following objects are not compiled for several reasons
# crypt.o
# netcrypt.o
# getcallerpc-$(OBJTYPE).o
# convD2M.o
# convM2D.o
# convM2S.o
# convS2M.o
OFILES=\
fmt/dofmt.o\
fmt/fltfmt.o\
@@ -112,10 +118,6 @@ OFILES=\
cistrncmp.o\
cistrstr.o\
cleanname.o\
convD2M.o\
convM2D.o\
convM2S.o\
convS2M.o\
create.o\
ctime.o\
date.o\
@@ -133,7 +135,6 @@ OFILES=\
execl.o\
fcallfmt.o\
get9root.o\
getcallerpc-$(OBJTYPE).o\
getenv.o\
getfields.o\
getnetconn.o\

View File

@@ -375,7 +375,7 @@ extern int encodefmt(Fmt*);
extern int dirmodefmt(Fmt*);
extern void exits(char*);
extern double frexp(double, int*);
extern ulong getcallerpc(void*);
/*extern ulong getcallerpc(void*);*/
extern char* p9getenv(char*);
extern int p9putenv(char*, char*);
extern int getfields(char*, char**, int, int, char*);

View File

@@ -21,15 +21,18 @@ void (*_wunlock)(RWLock*, ulong);
void
lock(Lock *l)
{
/*
if(_lock)
(*_lock)(l, 1, getcallerpc(&l));
else
l->held = 1;
*/
}
int
canlock(Lock *l)
{
/*
if(_lock)
return (*_lock)(l, 0, getcallerpc(&l));
else{
@@ -38,29 +41,36 @@ canlock(Lock *l)
l->held = 1;
return 1;
}
*/
return 1;
}
void
unlock(Lock *l)
{
/*
if(_unlock)
(*_unlock)(l, getcallerpc(&l));
else
l->held = 0;
*/
}
void
qlock(QLock *l)
{
/*
if(_qlock)
(*_qlock)(l, 1, getcallerpc(&l));
else
l->l.held = 1;
*/
}
int
canqlock(QLock *l)
{
/*
if(_qlock)
return (*_qlock)(l, 0, getcallerpc(&l));
else{
@@ -69,29 +79,36 @@ canqlock(QLock *l)
l->l.held = 1;
return 1;
}
*/
return 1;
}
void
qunlock(QLock *l)
{
/*
if(_qunlock)
(*_qunlock)(l, getcallerpc(&l));
else
l->l.held = 0;
*/
}
void
rlock(RWLock *l)
{
/*
if(_rlock)
(*_rlock)(l, 1, getcallerpc(&l));
else
l->readers++;
*/
}
int
canrlock(RWLock *l)
{
/*
if(_rlock)
return (*_rlock)(l, 0, getcallerpc(&l));
else{
@@ -100,29 +117,36 @@ canrlock(RWLock *l)
l->readers++;
return 1;
}
*/
return 1;
}
void
runlock(RWLock *l)
{
/*
if(_runlock)
(*_runlock)(l, getcallerpc(&l));
else
l->readers--;
*/
}
void
wlock(RWLock *l)
{
/*
if(_wlock)
(*_wlock)(l, 1, getcallerpc(&l));
else
l->writer = (void*)1;
*/
}
int
canwlock(RWLock *l)
{
/*
if(_wlock)
return (*_wlock)(l, 0, getcallerpc(&l));
else{
@@ -131,36 +155,46 @@ canwlock(RWLock *l)
l->writer = (void*)1;
return 1;
}
*/
return 1;
}
void
wunlock(RWLock *l)
{
/*
if(_wunlock)
(*_wunlock)(l, getcallerpc(&l));
else
l->writer = nil;
*/
}
void
rsleep(Rendez *r)
{
/*
if(_rsleep)
(*_rsleep)(r, getcallerpc(&r));
*/
}
int
rwakeup(Rendez *r)
{
/*
if(_rwakeup)
return (*_rwakeup)(r, 0, getcallerpc(&r));
*/
return 0;
}
int
rwakeupall(Rendez *r)
{
/*
if(_rwakeup)
return (*_rwakeup)(r, 1, getcallerpc(&r));
*/
return 0;
}