Re: [Vala] Need help in debugging async code



absolutly not tested my last patch attached that teorically solve all the issue:

now,

_state_in_progress_ is assigned to -1 at beginning
the check if

_state_in_progress_ == _state_ is move before the switch to work in any state.

Do you think that is good now?

2016-09-24 5:46 GMT+02:00 Nor Jaidi Tuah <norjaidi tuah ubd edu bn>:
If I understand your patch correctly, it would generate
something like this:


   if (_data_->_state_ != 1) {
      _data_->_state = 1;
      return FALSE;
   }
   else {
      // callback already called
   }
   etc. etc.


I don't think that's going to work with your use case.
_data_->_state_ would be stuck at 0 if you call the
callback before yield.

_state_in_progress_ simply doesn't help.



Nice day
Nor Jaidi Tuah



PRIVILEGED/CONFIDENTIAL information may be contained in this message. If you are neither the addressee 
(intended recipient) nor an authorised recipient of the addressee, and have received this message in error, 
please destroy this message (including attachments) and notify the sender immediately. STRICT PROHIBITION: 
This message, whether in part or in whole, should not be reviewed, retained, copied, reused, disclosed, 
distributed or used for any purpose whatsoever. Such unauthorised use may be unlawful and may contain 
material protected by the Official Secrets Act (Cap 153) of the Laws of Brunei Darussalam. DISCLAIMER: 
We/This Department/The Government of Brunei Darussalam, accept[s] no responsibility for loss or damage 
arising from the use of this message in any manner whatsoever. Our messages are checked for viruses but we 
do not accept liability for any viruses which may be transmitted in or with this message.

Attachment: safe_async_call_2.patch
Description: Text Data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]