- boost::mutex::scoped_lock lm (_mutex);
- list<shared_ptr<Job> >::iterator i = find (_jobs.begin(), _jobs.end(), after);
- assert (i != _jobs.end ());
- ++i;
- _jobs.insert (i, j);
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _jobs.push_back (j);
+ }
+
+ emit (boost::bind (boost::ref (JobAdded), weak_ptr<Job> (j)));
+
+ return j;