Skip to content

Commit 3b159c6

Browse files
committed
Revert linked failure (renaming runtime fns)
Revert "Rename runtime *_locked() and *_unlocked() fns to *_inner() (closes #2864)" This reverts commit b897696.
1 parent a10f52c commit 3b159c6

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

src/rt/rust_task.cpp

+15-15
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,11 @@ void rust_task::start()
231231
bool
232232
rust_task::must_fail_from_being_killed() {
233233
scoped_lock with(lifecycle_lock);
234-
return must_fail_from_being_killed_inner();
234+
return must_fail_from_being_killed_unlocked();
235235
}
236236

237237
bool
238-
rust_task::must_fail_from_being_killed_inner() {
238+
rust_task::must_fail_from_being_killed_unlocked() {
239239
lifecycle_lock.must_have_lock();
240240
return killed && !reentered_rust_stack && disallow_kill == 0;
241241
}
@@ -275,8 +275,8 @@ rust_task::kill() {
275275
// Unblock the task so it can unwind.
276276

277277
if (state == task_state_blocked &&
278-
must_fail_from_being_killed_inner()) {
279-
wakeup_inner(cond);
278+
must_fail_from_being_killed_unlocked()) {
279+
wakeup_locked(cond);
280280
}
281281

282282
LOG(this, task, "preparing to unwind task: 0x%" PRIxPTR, this);
@@ -377,10 +377,10 @@ void
377377
rust_task::transition(rust_task_state src, rust_task_state dst,
378378
rust_cond *cond, const char* cond_name) {
379379
scoped_lock with(lifecycle_lock);
380-
transition_inner(src, dst, cond, cond_name);
380+
transition_locked(src, dst, cond, cond_name);
381381
}
382382

383-
void rust_task::transition_inner(rust_task_state src, rust_task_state dst,
383+
void rust_task::transition_locked(rust_task_state src, rust_task_state dst,
384384
rust_cond *cond, const char* cond_name) {
385385
lifecycle_lock.must_have_lock();
386386
sched_loop->transition(this, src, dst, cond, cond_name);
@@ -398,12 +398,12 @@ rust_task::set_state(rust_task_state state,
398398
bool
399399
rust_task::block(rust_cond *on, const char* name) {
400400
scoped_lock with(lifecycle_lock);
401-
return block_inner(on, name);
401+
return block_locked(on, name);
402402
}
403403

404404
bool
405-
rust_task::block_inner(rust_cond *on, const char* name) {
406-
if (must_fail_from_being_killed_inner()) {
405+
rust_task::block_locked(rust_cond *on, const char* name) {
406+
if (must_fail_from_being_killed_unlocked()) {
407407
// We're already going to die. Don't block. Tell the task to fail
408408
return false;
409409
}
@@ -413,25 +413,25 @@ rust_task::block_inner(rust_cond *on, const char* name) {
413413
assert(cond == NULL && "Cannot block an already blocked task.");
414414
assert(on != NULL && "Cannot block on a NULL object.");
415415

416-
transition_inner(task_state_running, task_state_blocked, on, name);
416+
transition_locked(task_state_running, task_state_blocked, on, name);
417417

418418
return true;
419419
}
420420

421421
void
422422
rust_task::wakeup(rust_cond *from) {
423423
scoped_lock with(lifecycle_lock);
424-
wakeup_inner(from);
424+
wakeup_locked(from);
425425
}
426426

427427
void
428-
rust_task::wakeup_inner(rust_cond *from) {
428+
rust_task::wakeup_locked(rust_cond *from) {
429429
assert(cond != NULL && "Cannot wake up unblocked task.");
430430
LOG(this, task, "Blocked on 0x%" PRIxPTR " woken up on 0x%" PRIxPTR,
431431
(uintptr_t) cond, (uintptr_t) from);
432432
assert(cond == from && "Cannot wake up blocked task on wrong condition.");
433433

434-
transition_inner(task_state_blocked, task_state_running, NULL, "none");
434+
transition_locked(task_state_blocked, task_state_running, NULL, "none");
435435
}
436436

437437
void
@@ -685,7 +685,7 @@ rust_task::wait_event(bool *killed) {
685685
scoped_lock with(lifecycle_lock);
686686

687687
if(!event_reject) {
688-
block_inner(&event_cond, "waiting on event");
688+
block_locked(&event_cond, "waiting on event");
689689
lifecycle_lock.unlock();
690690
yield(killed);
691691
lifecycle_lock.lock();
@@ -702,7 +702,7 @@ rust_task::signal_event(void *event) {
702702
this->event = event;
703703
event_reject = true;
704704
if(task_state_blocked == state) {
705-
wakeup_inner(&event_cond);
705+
wakeup_locked(&event_cond);
706706
}
707707
}
708708

src/rt/rust_task.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,10 @@ rust_task : public kernel_owned<rust_task>
208208

209209
void transition(rust_task_state src, rust_task_state dst,
210210
rust_cond *cond, const char* cond_name);
211-
void transition_inner(rust_task_state src, rust_task_state dst,
211+
void transition_locked(rust_task_state src, rust_task_state dst,
212212
rust_cond *cond, const char* cond_name);
213213

214-
bool must_fail_from_being_killed_inner();
214+
bool must_fail_from_being_killed_unlocked();
215215
// Called by rust_task_fail to unwind on failure
216216
void begin_failure(char const *expr,
217217
char const *file,
@@ -226,8 +226,8 @@ rust_task : public kernel_owned<rust_task>
226226
char const *file,
227227
size_t line);
228228

229-
bool block_inner(rust_cond *on, const char* name);
230-
void wakeup_inner(rust_cond *from);
229+
bool block_locked(rust_cond *on, const char* name);
230+
void wakeup_locked(rust_cond *from);
231231

232232
public:
233233

0 commit comments

Comments
 (0)