Rev 1 | Rev 68 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1 | Rev 15 | ||
---|---|---|---|
Line 78... | Line 78... | ||
78 | { |
78 | { |
79 | pri_t pri; |
79 | pri_t pri; |
80 | int rc; |
80 | int rc; |
81 | 81 | ||
82 | pri = cpu_priority_high(); |
82 | pri = cpu_priority_high(); |
83 | spinlock_lock(&the->thread->lock); |
83 | spinlock_lock(&THREAD->lock); |
84 | the->thread->rwlock_holder_type = RWLOCK_WRITER; |
84 | THREAD->rwlock_holder_type = RWLOCK_WRITER; |
85 | spinlock_unlock(&the->thread->lock); |
85 | spinlock_unlock(&THREAD->lock); |
86 | cpu_priority_restore(pri); |
86 | cpu_priority_restore(pri); |
87 | 87 | ||
88 | /* |
88 | /* |
89 | * Writers take the easy part. |
89 | * Writers take the easy part. |
90 | * They just need to acquire the exclusive mutex. |
90 | * They just need to acquire the exclusive mutex. |
Line 118... | Line 118... | ||
118 | { |
118 | { |
119 | int rc; |
119 | int rc; |
120 | pri_t pri; |
120 | pri_t pri; |
121 | 121 | ||
122 | pri = cpu_priority_high(); |
122 | pri = cpu_priority_high(); |
123 | spinlock_lock(&the->thread->lock); |
123 | spinlock_lock(&THREAD->lock); |
124 | the->thread->rwlock_holder_type = RWLOCK_READER; |
124 | THREAD->rwlock_holder_type = RWLOCK_READER; |
125 | spinlock_unlock(&the->thread->lock); |
125 | spinlock_unlock(&THREAD->lock); |
126 | 126 | ||
127 | spinlock_lock(&rwl->lock); |
127 | spinlock_lock(&rwl->lock); |
128 | 128 | ||
129 | /* |
129 | /* |
130 | * Find out whether we can get what we want without blocking. |
130 | * Find out whether we can get what we want without blocking. |