Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 630 vs 631 for /trunk/Source Code/Platform/Threading/Task.cpp

Diff revisions: vs.
  @@ -36,7 +36,7 @@
36 36 stopTask();
37 37 }
38 38
39 - WAIT_FOR_CONDITION(_done);
39 + WAIT_FOR_CONDITION(_done || _tp.active() == 0);
40 40 }
41 41
42 42 void Task::updateTickInterval(U64 tickInterval) {
  @@ -48,7 +48,8 @@
48 48 }
49 49
50 50 void Task::startTask(TaskPriority priority) {
51 - if (!_tp.schedule(PoolTask(to_uint(priority), [&](){ run(); }))) {
51 + if (!_tp.schedule(PoolTask(to_uint(priority), DELEGATE_BIND(&Task::run, this))))
52 + {
52 53 Console::errorfn(Locale::get(_ID("TASK_SCHEDULE_FAIL")));
53 54 }
54 55 }
  @@ -72,7 +73,7 @@
72 73
73 74 Application& app = Application::getInstance();
74 75
75 - _done = false;
76 + _done = !_callback;
76 77 while (true) {
77 78 if (_numberOfTicks == 0) {
78 79 _end = true;
  @@ -82,7 +83,7 @@
82 83 break;
83 84 }
84 85
85 - while ((_paused && !_end) && !app.ShutdownRequested()) {
86 + if (_paused) {
86 87 continue;
87 88 }
88 89
  @@ -99,7 +100,7 @@
99 100 }
100 101 }
101 102
102 - }
103 + }
103 104
104 105 Console::d_printfn(Locale::get(_ID("TASK_DELETE_THREAD")), getGUID(), std::this_thread::get_id());
105 106