Pearl diver's status can only be asynchronously assigned value of SEARCH_FINISHED. So even if two threads change status value it's always going to be SEARCH_FINISHED.
The lock might be needed if pearl diver supported interruption logic. In this case the access to status variable must be exclusive.
Pearl diver's
status
can only be asynchronously assigned value ofSEARCH_FINISHED
. So even if two threads changestatus
value it's always going to beSEARCH_FINISHED
.The lock might be needed if pearl diver supported interruption logic. In this case the access to
status
variable must be exclusive.