|
|
Home » U++ Library support » U++ MT-multithreading and servers » ASyncWork/CoWork Cancel() method leads to deadlock (when used with GuiLock)
ASyncWork/CoWork Cancel() method leads to deadlock (when used with GuiLock) [message #50203] |
Sun, 26 August 2018 20:16 |
Oblivion
Messages: 1094 Registered: August 2007
|
Senior Contributor |
|
|
Hello,
This happens on both linux (latest) and Window 7/10.
When I try to cancel any AsyncWork/CoWork-based threads that access/modify gui elements (using GuiLock) application simply hangs.
(OTOH, If i use a simple cancelleation flag instead, everything works well. But obviously it work like a "cancel all" command)
I attached a simple example, and here is its log:
CoWork constructed 7f66af217ca0
Do0, looper: false, previous todo: 0
Pool::InitThreads: 8
CoWork thread #0 started
CoWork thread #1 started
CoWork thread #2 started
CoWork thread #4 started
CoWork thread #3 started
CoWork thread #5 started
CoWork thread #6 started
CoWork thread #7 started
#2 Waiting for job
#5 Waiting for job
#0 Waiting for job
#4 Waiting for job
#1 Waiting for job
#7 Waiting for job
#3 Waiting for job
#6 Waiting for job
Adding job
Releasing thread waiting for job, waiting threads: 8
#2 Waiting ended
#2 Job acquired
CoWork constructed 7f66af217d80
DoJob (CoWork 7f66af217ca0)
Thread #0 started.
Do0, looper: false, previous todo: 0
Adding job
Releasing thread waiting for job, waiting threads: 7
CoWork constructed 7f66af217e60
#5 Waiting ended
#5 Job acquired
DoJob (CoWork 7f66af217d80)
Thread #1 started.
Do0, looper: false, previous todo: 0
Adding job
Releasing thread waiting for job, waiting threads: 6
#0 Waiting ended
#0 Job acquired
CoWork constructed 7f66af217f40
DoJob (CoWork 7f66af217e60)
Thread #2 started.
Do0, looper: false, previous todo: 0
Adding job
Releasing thread waiting for job, waiting threads: 5
#4 Waiting ended
#4 Job acquired
DoJob (CoWork 7f66af217f40)
Thread #3 started.
CoWork Cancel0
WaitForFinish (CoWork 7f66af217ca0)
What am I doing wrong?
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Sun, 26 August 2018 20:19] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Wed May 15 04:16:18 CEST 2024
Total time taken to generate the page: 0.02921 seconds
|
|
|