40 lines · 683 B · C
RawDownload
#include <u.h>#include <libc.h>#include "iotrack.h"#include "dat.h"#include "fns.h" voidmlock(MLock *l){	if(l->key != 0 && l->key != 1)		panic("uninitialized lock");	if (l->key)		panic("lock lock %#p unlock %#p", l->lockpc, l->unlockpc);	l->key = 1;	l->lockpc = getcallerpc(&l);} voidunmlock(MLock *l){ 	if(l->key != 0 && l->key != 1)		panic("uninitialized unlock");	if (!l->key)		panic("unlock lock %#p unlock %#p", l->lockpc, l->unlockpc);	l->key = 0;	l->unlockpc = getcallerpc(&l);} intcanmlock(MLock *l){	if(l->key != 0 && l->key != 1)		panic("uninitialized canlock");	if (l->key)		return 0;	l->key = 1;	l->lockpc = getcallerpc(&l);	return 1;}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t