Skip to content

Commit

Permalink
Add some comments and update documentation link.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee-Janggun committed Oct 31, 2024
1 parent a9ac6e6 commit 47d9787
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ The course aims to equip students with the ability to:
### Textbook

- [Slides](https://docs.google.com/presentation/d/1NMg08N1LUNDPuMxNZ-UMbdH13p8LXgMM3esbWRMowhU/edit?usp=sharing)
- [Code Documentation](https://kaist-cp.github.io/cs431/cs431/)
- References
+ [The Art of Multiprocessor Programming](https://dl.acm.org/doi/book/10.5555/2385452)
+ [The Crossbeam Library Documentation](https://docs.rs/crossbeam/latest/crossbeam/)
Expand Down Expand Up @@ -181,7 +182,7 @@ Ensure you are proficient with the following development tools:
- All assignments will be announced at the start of the semester.
- Submit your solutions to <https://gg.kaist.ac.kr/course/19>.
- Refer to the documentation at <https://www.fearless.systems/cs431/cs431_homework/>.
- Refer to the documentation at <https://kaist-cp.github.io/cs431/cs431_homework/>.
- You are **permitted** to use ChatGPT or other LLMs.
Expand Down
3 changes: 3 additions & 0 deletions src/lock/mcsparkinglock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ unsafe impl RawLock for McsParkingLock {
// SAFETY: See safety of McsLock::unlock().
drop(unsafe { Box::from_raw(node) });
let next_ref = unsafe { &*next };

// It is important to clone the thread before unlocking, the next waiter,
// because then the next waiter may free `next_ref`.
let thread = next_ref.thread.clone();
next_ref.locked.store(false, Release);
thread.unpark();
Expand Down

0 comments on commit 47d9787

Please sign in to comment.