| 493 | } |
| 494 | |
| 495 | bool callBackSetProgress( float p ) |
| 496 | { |
| 497 | auto& instance = ProgressBarImpl::instance(); |
| 498 | |
| 499 | // set instance.allowCancel_ = true but write in memory only if it was false |
| 500 | bool expected = false; |
| 501 | instance.allowCancel_.compare_exchange_strong( expected, true, std::memory_order_relaxed ); |
| 502 | |
| 503 | setProgress( ( p + float( instance.currentTask_ - 1 ) ) / instance.taskCount_ ); |
| 504 | return !instance.canceled_; |
| 505 | } |
| 506 | |
| 507 | bool simpleCallBackSetProgress( float p ) |
| 508 | { |
no test coverage detected