Commit f2479896 authored by claes's avatar claes

Wait for all threads to set it's priority before changing real and effective user id

parent df3076e6
/*
* Proview $Id: rt_plc_thread.c,v 1.10 2005-09-01 14:57:56 claes Exp $
* Proview $Id: rt_plc_thread.c,v 1.11 2006-09-05 12:17:00 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -94,6 +94,10 @@ plc_thread (
(int) (tp->PlcThread->ScanTime * 1000), tp->prio);
}
que_Put(&sts, &tp->q_out, &tp->event, (void *)1);
phase = (int)que_Get(&sts, &tp->q_in, NULL, NULL);
pwr_Assert(phase == 2);
/* Once thread's has set it's priority don't run as root */
#if defined(OS_LINUX)
......@@ -111,10 +115,6 @@ plc_thread (
setreuid(ruid, ruid);
#endif
que_Put(&sts, &tp->q_out, &tp->event, (void *)1);
phase = (int)que_Get(&sts, &tp->q_in, NULL, NULL);
pwr_Assert(phase == 2);
/* Phase 2. */
tp->init(2, tp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment