Comment 19 for bug 2039577

Revision history for this message
Robert Ancell (robert-ancell) wrote (last edit ):

The pattern I tend to use for async glib code in parallel is:

```
struct {
   bool have_result1 // Or an object if can instead check != NULL
   bool have_result2
}

check_result() {
  if (!have_result1 || !have_result2){
     return;
  }

  do_the_thing().
}

result1_cb {
   have_result1 = true
   check_result()
}

result2_cb {
   have_result2 = true
   check_result()
}

do_check() {
   check1(have_result1)
   check2(have_result2)
}
```