Skip to content

Commit

Permalink
Fix condition/lock.
Browse files Browse the repository at this point in the history
  • Loading branch information
pasuder committed Jan 29, 2015
1 parent d65ead2 commit 4c8a4e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/amberdriver/hokuyo/hokuyo_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ def __handle_get_single_scan(self, received_header, received_message, response_h
self.__logger.debug('Get single scan')

try:
self.__subscribers_condition.acquire()
self.__subscribers_lock.acquire()
if len(self.__subscribers) == 0:
angles, distances, timestamp = self.__get_and_set_scan_now()
else:
angles, distances, timestamp = self.__get_scan()

finally:
self.__subscribers_condition.release()
self.__subscribers_lock.release()

response_message = HokuyoController.__fill_scan(response_message, angles, distances, timestamp)

Expand Down

0 comments on commit 4c8a4e0

Please sign in to comment.