... | ... | @@ -346,7 +346,7 @@ while not stopping.is_set(): |
|
|
|
|
|
The Python example follows the same principle as the C++ and Java examples but this time we use the *Event* object provided by the *threading* module to share the stopping state.
|
|
|
|
|
|
To finish, it is highly recommended to implement stop handler this way:
|
|
|
To finish, it is **highly recommended** to implement a stop handler this way:
|
|
|
* Do not implement cleaning code e.g. resource deallocation in stop handlers.
|
|
|
* Only write code that unblocks blocking calls: graphical loop, etc.
|
|
|
* Let the cleaning code at the very end of the main. |