diff options
author | Jason Evans <jasone@FreeBSD.org> | 2000-10-04 01:29:17 +0000 |
---|---|---|
committer | Jason Evans <jasone@FreeBSD.org> | 2000-10-04 01:29:17 +0000 |
commit | a18b1f1d4ddeb48bde093cc8a8ecf5d48391a03c (patch) | |
tree | be38329315e26593acf6a8b824bb4069d9701eba /sys/netncp/ncp_conn.c | |
parent | 645b8b81f004da9bf1d09dd4707177be1640f1f9 (diff) | |
download | src-a18b1f1d4ddeb48bde093cc8a8ecf5d48391a03c.tar.gz src-a18b1f1d4ddeb48bde093cc8a8ecf5d48391a03c.zip |
Convert lockmgr locks from using simple locks to using mutexes.
Add lockdestroy() and appropriate invocations, which corresponds to
lockinit() and must be called to clean up after a lockmgr lock is no
longer needed.
Notes
Notes:
svn path=/head/; revision=66615
Diffstat (limited to 'sys/netncp/ncp_conn.c')
-rw-r--r-- | sys/netncp/ncp_conn.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/netncp/ncp_conn.c b/sys/netncp/ncp_conn.c index 3cfc4491909b..df86f99bfd01 100644 --- a/sys/netncp/ncp_conn.c +++ b/sys/netncp/ncp_conn.c @@ -79,6 +79,13 @@ ncp_conn_init(void) { } int +ncp_conn_destroy(void) { + lockdestroy(&listlock); + lockdestroy(&lhlock); + return 0; +} + +int ncp_conn_locklist(int flags, struct proc *p){ return lockmgr(&listlock, flags | LK_CANRECURSE, 0, p); } @@ -231,6 +238,7 @@ ncp_conn_free(struct ncp_conn *ncp) { * if signal is raised - how I do react ? */ lockmgr(&ncp->nc_lock, LK_DRAIN, 0, ncp->procp); + lockdestroy(&ncp->nc_lock); while (ncp->nc_lwant) { printf("lwant = %d\n", ncp->nc_lwant); tsleep(&ncp->nc_lwant, PZERO,"ncpdr",2*hz); |