Temporarily disabling task switching.
.
.
bw=write(serialport, &command, 1); // Write command - simply just the slave address
if (bw!=1)
err_sys("Could not write to serial port ");
ticks1=times(&buf); // Get time
br1=read(serialport, &responce[0], 1); // Read slave response
ticks2=times(&buf); // Get time
.
.
.
I then calculate the time delay from tick1s and ticks2.
This works, however if other processes are fired up (an application is started for e.g.) this process is being interrupted more often and the slave response time delay increases.
Is there a way to temporarily disable other tasks from interrupting this process over this critical section of code?
Jeff.
MacBook, Mac OS X (10.5.8)