[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[OT] How to make a "critical section" in user program?



Hi All!

I have yet another "real time" question.
Is it possible to make a part of my program a "critical section", so that
during execution of this part of code my program can not be suspended?
I'd like to be able to send a data through the serial port at the known time,
using something like this (CommFd is the comm device descriptor):

timeval tv;
char c=0;
tcdrain(CommFd);
begin_critical_section();
gettimeofday(&tv,NULL);
write(CommFd,&c,1);
end_critical_section();

How to do such thing? 
-- 
	                      Wojciech M. Zabolotny
	http://www.ise.pw.edu.pl/~wzab  <--> wzab@ise.pw.edu.pl

http://www.gnupg.org  Gnu Privacy Guard - protect your mail & data
                      with the FREE cryptographic system


Reply to: