Last active
August 29, 2015 14:06
-
-
Save awreece/c4a2d8e28b7da00aa3e2 to your computer and use it in GitHub Desktop.
spot the bug 2013
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def swap(threaded_array, i, j): | |
threaded_array.locks[i].lock() | |
threaded_array.locks[j].lock() | |
threaded_array.data[i], threaded_array.data[j] = \ | |
threaded_array.data[j], threaded_array.data[i] | |
threaded_array.locks[j].unlock() | |
threaded_array.locks[i].unlock() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment