Plan 9 from Bell Labs’s /usr/web/sources/contrib/rsc/9load/20040703/ilock.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#include "u.h"
#include "lib.h"
#include "mem.h"
#include "dat.h"
#include "fns.h"
#include "io.h"

void
ilock(Lock *lk)
{
	if(lk->locked != 0)
		panic("ilock");
	lk->spl = splhi();
	lk->locked = 1;
}

void
iunlock(Lock *lk)
{
	if(lk->locked != 1)
		panic("iunlock");
	lk->locked = 0;
	splx(lk->spl);
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].