Removed obsolete (uncompiled) code fro global locking.

This commit is contained in:
kozubal
1991-11-27 08:51:14 +00:00
parent 6f74cb0672
commit b6b65dd59c

View File

@@ -19,6 +19,7 @@
16aug91,ajk Improved "magic number" error message.
25oct91,ajk Code to create semaphores "ss_ptr->getSemId" was left out.
Added this code to init_sscb().
25nov91,ajk Removed obsolete seqLog() code dealing with global locking.
***************************************************************************/
/*#define DEBUG 1*/
@@ -386,11 +387,6 @@ int nChar;
return NULL;
}
/* Initialize logging */
/****#define GLOBAL_LOCK****/
#ifdef GLOBAL_LOCK
SEM_ID seq_log_sem = NULL;
#endif
LOCAL VOID seq_logInit(sp_ptr)
SPROG *sp_ptr;
{
@@ -398,12 +394,7 @@ SPROG *sp_ptr;
int fd;
/* Create a logging resource locking semaphore */
#ifdef GLOBAL_LOCK
if (seq_log_sem == NULL)
seq_log_sem = semMCreate(SEM_INVERSION_SAFE | SEM_DELETE_SAFE);
#else
sp_ptr->logSemId = semMCreate(SEM_INVERSION_SAFE | SEM_DELETE_SAFE);
#endif
sp_ptr->logFd = ioGlobalStdGet(1); /* default fd is std out */
/* Check for logfile spec. */
@@ -438,22 +429,15 @@ int arg1, arg2, arg3, arg4, arg5, arg6; /* arguments */
timeBfr[17] = 0;
/* Lock seq_log resource */
#ifdef GLOBAL_LOCK
semTake(seq_log_sem, WAIT_FOREVER);
#else
semTake(sp_ptr->logSemId, WAIT_FOREVER);
#endif
/* Print the message: e.g. "10:23:28 T13: ...." */
fd = sp_ptr->logFd;
fdprintf(fd, "%s %s: ", taskName(taskIdSelf()), &timeBfr[9]);
fdprintf(fd, fmt, arg1, arg2, arg3, arg4, arg5, arg6);
/* Unlock the resource */
#ifdef GLOBAL_LOCK
semGive(seq_log_sem);
#else
semGive(sp_ptr->logSemId);
#endif
/* If NSF file then flush the buffer */
if (fd != ioGlobalStdGet(1) )
@@ -463,6 +447,7 @@ int arg1, arg2, arg3, arg4, arg5, arg6; /* arguments */
return;
}
/* seqLog() - State program interface to seq_log() */
VOID seqLog(fmt, arg1, arg2, arg3, arg4, arg5, arg6)
char *fmt; /* format string */