Program execution order like FIFO queue

Hi all:

I have a problem with a C++ service runing on solaris 10. This service only set a signal on oracle table. When the service detect a cut off on the line (tcp/ip), trigger a cobol program for set the signal OFF. When the line is on again, the service trigger the same cobol program for set the signal ON.
This service and program work fine, except when a micro cut occurs. In this scenario, the actions are:

Signal on oracle table is initialized: ON.
Micro cut occurs:
The service trigger a cobol program setting the signal to OFF
The line is ON again:
The service trigger a cobol program setting the signal to ON

But for some reason, the cobol program for set to ON the signal run first (or finish first?) that the cobol program for set to OFF the signal, like show this log:

08:55:044 - Signal set to ON
12:05:011 - Signal set to ON
12:05:012 - Signal set to OFF

Before change the code of my programs, any suggestions about how I take the control of the program execution order?
Thanks in advance
Hern�n Castellani