Skip to content

Commit a3a800e

Browse files
committed
change wording of rwlockmode
1 parent c72ff6a commit a3a800e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/concurrency/sync.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ declare_id!(CondvarId);
118118

119119
#[derive(Debug, Copy, Clone)]
120120
pub enum RwLockMode {
121-
Shared,
122-
Exclusive,
121+
Read,
122+
Write,
123123
}
124124

125125
#[derive(Debug)]

src/shims/windows/sync.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ trait EvalContextExtPriv<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
2525
this.unblock_thread(thread);
2626

2727
match mode {
28-
RwLockMode::Shared =>
28+
RwLockMode::Read =>
2929
if this.rwlock_is_write_locked(lock) {
3030
this.rwlock_enqueue_and_block_reader(lock, thread);
3131
} else {
3232
this.rwlock_reader_lock(lock, thread);
3333
},
34-
RwLockMode::Exclusive =>
34+
RwLockMode::Write =>
3535
if this.rwlock_is_locked(lock) {
3636
this.rwlock_enqueue_and_block_writer(lock, thread);
3737
} else {
@@ -384,18 +384,18 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
384384

385385
let shared_mode = 0x1; // CONDITION_VARIABLE_LOCKMODE_SHARED is not in std
386386
let mode = if flags == 0 {
387-
RwLockMode::Exclusive
387+
RwLockMode::Write
388388
} else if flags == shared_mode {
389-
RwLockMode::Shared
389+
RwLockMode::Read
390390
} else {
391391
throw_unsup_format!("unsupported `Flags` {flags} in `SleepConditionVariableSRW`");
392392
};
393393

394394
let active_thread = this.get_active_thread();
395395

396396
let was_locked = match mode {
397-
RwLockMode::Shared => this.rwlock_reader_unlock(lock_id, active_thread),
398-
RwLockMode::Exclusive => this.rwlock_writer_unlock(lock_id, active_thread),
397+
RwLockMode::Read => this.rwlock_reader_unlock(lock_id, active_thread),
398+
RwLockMode::Write => this.rwlock_writer_unlock(lock_id, active_thread),
399399
};
400400

401401
if !was_locked {

0 commit comments

Comments
 (0)