kylemcdonald / ofxEdsdk

Interfacing with Canon cameras from openFrameworks for OSX. An alternative to ofxCanon and CanonCameraWrapper.
Other
111 stars 51 forks source link

waitForThread() is never ending #30

Closed Taprik closed 9 years ago

Taprik commented 9 years ago

With OF 0.8.4, OSX.8.5, EOS 600D The first time the example runs successfully. When I tried to stop it won't stop and is never ending the waitForThread() function of the destructor. In the console you can read : [verbose] ofThread: - name: Thread 1 - External thread unlocked the ofThread mutex. [verbose] ofThread: - name: Thread 1 - ofThread waiting for its own mutex to be unlocked. [verbose] ofThread: - name: Thread 1 - ofThread locked its own mutex. [verbose] ofThread: - name: Thread 1 - ofThread unlocked its own mutex. [verbose] ofThread: - name: Thread 1 - Signaled to stop. [verbose] ofThread: - name: Thread 1 - waiting to stop

I had to force the application to quit. The second time it won't run and the console says : [verbose] ofThread: - name: Thread 1 - Started Thread. [verbose] ofThread: - name: Thread 1 - ofThread waiting for its own mutex to be unlocked. [verbose] ofThread: - name: Thread 1 - ofThread locked its own mutex. [ error ] There was an error opening the camera, or starting live view: EDS_ERR_COMM_PORT_IS_IN_USE inside OpenSession() [verbose] ofThread: - name: Thread 1 - Thread Finished.

I had to restart the computer.

When I comment the waitForThread() function and add a stopThread() function (it's the same without the stopThread() function), there is no hanging at exit of the application and the console says : [[verboseverbose] ] ofThreadofThread: : - name: Thread 1 - External thread unlocked the ofThread mutex.- name: Thread 1 - ofThread locked its own mutex.

[verbose] ofThread: - name: Thread 1 - ofThread unlocked its own mutex.

Taprik commented 9 years ago

Actually waitForThread(true, 100); is also working.

kylemcdonald commented 9 years ago

i've moved the session closing and cleanup to a close() method instead of the destructor. i've also added a 500ms timeout on closing. please try again.