comparison src/spinlock.c @ 37:fb3e5a2f76c1

fix
author mir3636
date Fri, 22 Feb 2019 22:36:17 +0900
parents ad1d3b268e2d
children
comparison
equal deleted inserted replaced
36:d4e5846ddb48 37:fb3e5a2f76c1
44 getcallerpcs(get_fp(), lk->pcs); 44 getcallerpcs(get_fp(), lk->pcs);
45 45
46 #endif 46 #endif
47 } 47 }
48 48
49 /*
49 void cbc_acquire(struct spinlock *lk, __code (*next)(int ret)) 50 void cbc_acquire(struct spinlock *lk, __code (*next)(int ret))
50 { 51 {
51 pushcli(); // disable interrupts to avoid deadlock. 52 pushcli(); // disable interrupts to avoid deadlock.
52 lk->locked = 1; // set the lock status to make the kernel happy 53 lk->locked = 1; // set the lock status to make the kernel happy
53 54
66 getcallerpcs(get_fp(), lk->pcs); 67 getcallerpcs(get_fp(), lk->pcs);
67 68
68 #endif 69 #endif
69 goto next(); 70 goto next();
70 } 71 }
72 */
71 73
74 /*
72 // Release the lock. 75 // Release the lock.
73 void cbc_release(struct spinlock *lk, __code (*next)(int ret)) 76 void cbc_release(struct spinlock *lk, __code (*next)(int ret))
74 { 77 {
75 #if 0 78 #if 0
76 if(!holding(lk)) 79 if(!holding(lk))
93 96
94 lk->locked = 0; // set the lock state to keep the kernel happy 97 lk->locked = 0; // set the lock state to keep the kernel happy
95 popcli(); 98 popcli();
96 goto next(); 99 goto next();
97 } 100 }
101 */
98 102
99 void release(struct spinlock *lk) 103 void release(struct spinlock *lk)
100 { 104 {
101 #if 0 105 #if 0
102 if(!holding(lk)) 106 if(!holding(lk))