Skip to content

Commit

Permalink
implement timeQ of runQ
Browse files Browse the repository at this point in the history
Signed-off-by: yayanyang <yayanyang@gmail.com>
  • Loading branch information
yayanyang committed Dec 15, 2012
1 parent 75b8660 commit b994767
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
24 changes: 24 additions & 0 deletions runQ/functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,30 @@ namespace lemon{ namespace runQ{
LemonCloseJob(s,id);
}

void start_timer(LemonRunQ s, lemon_job_id id,size_t milliseconds)
{
error_info errorCode;

LemonRunQTimerStart(s,id,milliseconds * 1000 * 10,errorCode);

errorCode.check_throw();
}

void stop_timer(LemonRunQ s, lemon_job_id id)
{
LemonRunQTimerStop(s,id);
}

void send_timeout(LemonRunQ s, lemon_job_id id)
{
LemonJobTimeout(s,id);
}

size_t jobs(LemonRunQ s)
{
return LemonRunQJobs(s);
}

}}

#endif //LEMONXX_RUNQ_FUNCTIONS_HPP
30 changes: 30 additions & 0 deletions runQ/job.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,36 @@ namespace lemon{namespace runQ{
runQ::free(Q,buffer);
}

void start_timer(job_id job,size_t milliseconds)
{
runQ::start_timer(Q,job,milliseconds);
}

void start_timer(size_t milliseconds)
{
runQ::start_timer(Q,_id,milliseconds);
}

void stop_timer(job_id job)
{
runQ::stop_timer(Q,job);
}

void stop_timer()
{
runQ::start_timer(Q,_id);
}

void send_timeout()
{
runQ::send_timeout(Q,_id);
}

void send_timeout(job_id job)
{
runQ::send_timeout(Q,job);
}

private:

static void* __initialize(LemonRunQ Q,lemon_job_id id,LemonErrorInfo* errorCode)
Expand Down
6 changes: 5 additions & 1 deletion runQ/service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ namespace lemon{

void reset()
{
LemonRunQReset(*this);
error_info errorCode;

LemonRunQReset(*this,&errorCode);

errorCode.check_throw();
}

size_t jobs() const
Expand Down

0 comments on commit b994767

Please sign in to comment.