gtpc2m47 | C/C++ Language Support User's Guide |
This function synchronizes the field or record across processors in a loosely coupled complex and then unlocks the field or record. The glob_lock function must have previously been called. This function is valid only for synchronizable TPF global fields and records.
Format
#include <tpfglbl.h> #include <c$globz.h> void glob_sync(unsigned int tagname);
Normal Return
Void.
Error Return
Not applicable.
Programming Considerations
Examples
The following example locks, updates and synchronizes a global field.
#include <tpfglbl.h> #include <c$globz.h>
·
·
·
{ /******************************************************************/ /* Increment data element mysdata in synchronizable global record */ /* _mysglob. */ /******************************************************************/ struct mysglbrec **msgrptrptr = glob_lock(_mysglob); struct mysglbrec *msgrptr = *msgrptrptr; long newdata = msgrptr->mysdata + 1; glob_modify(_mysglob, &msgrptr->mysdata, &newdata, sizeof msgrptr->mysdata); glob_sync(_mysglob); }
Related Information