public void Run() { try { // Execute the operation _result = _op(_parameter); // Success lock(this) _state = 1; } catch(Exception ex) { // Remember the exception details _exception = ex; // Failed with exception lock(this) _state = 2; } }