b10f179608
Both thread and isolate have sticky error fields. Dart API was using isolate's sticky error, while Dart code was using thread's sticky error. There was a one-way move of a thread's sticky error into isolate when thread was unscheduled. This causes a problem as error in the isolate may go unnoticed and repeated unscheduling/re-scheduling might end up overwriting the error in the isolate (which triggers the assertion). To solve this problem, this CL: * Cleans up Dart API which manipulates isolate's sticky error, so isolate's sticky error is never set directly. * When sceduling an isolate to a thread, sticky error is moved back from isolate (if any). With this changes, thread's sticky error is always used if thread is running, and isolate's sticky error is only used to hold sticky error while isolate has no thread. Fixes https://github.com/dart-lang/sdk/issues/35590 Change-Id: I99b128cac363ca2df75f6e64c083b1ec36c866ce Reviewed-on: https://dart-review.googlesource.com/c/89442 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>