summaryrefslogtreecommitdiff
path: root/spinlock.c
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2016-09-02 05:40:54 -0400
committerRobert Morris <[email protected]>2016-09-02 05:40:54 -0400
commitbc8221a59c083811ee2d8c49c0342ea59caa6d51 (patch)
treeb3ba908c45b694dfa60578100b6662e3bfdfba3c /spinlock.c
parent4b2152cc2d46865f3e4be011698b7a49bca794b8 (diff)
downloadxv6-labs-bc8221a59c083811ee2d8c49c0342ea59caa6d51.tar.gz
xv6-labs-bc8221a59c083811ee2d8c49c0342ea59caa6d51.tar.bz2
xv6-labs-bc8221a59c083811ee2d8c49c0342ea59caa6d51.zip
comment about sched() saving/restoring cpu->intena
Diffstat (limited to 'spinlock.c')
-rw-r--r--spinlock.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/spinlock.c b/spinlock.c
index a5f0b21..bf863ef 100644
--- a/spinlock.c
+++ b/spinlock.c
@@ -102,8 +102,9 @@ pushcli(void)
eflags = readeflags();
cli();
- if(cpu->ncli++ == 0)
+ if(cpu->ncli == 0)
cpu->intena = eflags & FL_IF;
+ cpu->ncli += 1;
}
void