|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: B T
Length: 3204 (0xc84)
Types: TextFile
Names: »B«
└─⟦516dceb10⟧ Bits:30000751 8mm tape, Rational 1000, RCI_VADS
└─⟦9a14c9417⟧ »DATA«
└─⟦this⟧
-- Copyright 1986,1987,1988 Verdix Corporation
WITH System;
USE System;
WITH V_I_Types;
WITH V_I_Sema;
WITH V_I_Time;
WITH V_I_Timeop;
WITH V_Tas;
PACKAGE BODY V_Sema IS
PRAGMA Suppress (All_Checks);
PRAGMA Suppress (Exception_Tables);
Priority_Inheritance_Enabled : Boolean;
PRAGMA Interface_Name (Priority_Inheritance_Enabled,
"PRIORITY_INHERITANCE_ENABLED");
--
-- Kernel semaphore support services
--
PROCEDURE Krn_Suspend (S : V_I_Sema.A_Semaphore);
PRAGMA Interface (Ada, Krn_Suspend);
PRAGMA Interface_Name (Krn_Suspend, "KRN_SUSPEND");
FUNCTION Krn_Timed_Suspend
(S : V_I_Sema.A_Semaphore; Timeout : Duration) RETURN Boolean;
PRAGMA Interface (Ada, Krn_Timed_Suspend);
PRAGMA Interface_Name (Krn_Timed_Suspend, "KRN_TIMED_SUSPEND");
PROCEDURE Krn_Resume (S : V_I_Sema.A_Semaphore);
PRAGMA Interface (Ada, Krn_Resume);
PRAGMA Interface_Name (Krn_Resume, "KRN_RESUME");
--
-- Time operators
--
FUNCTION "+" (Left : V_I_Types.Time_T; Right : V_I_Types.Time_T)
RETURN V_I_Types.Time_T RENAMES V_I_Timeop."+";
FUNCTION "-" (Left : V_I_Types.Time_T; Right : V_I_Types.Time_T)
RETURN Duration RENAMES V_I_Timeop."-";
FUNCTION "<=" (Left : V_I_Types.Time_T; Right : V_I_Types.Time_T)
RETURN Boolean RENAMES V_I_Timeop."<=";
--
-- Support services from the archive semaphore routines
--
FUNCTION Prio_Inherit_Conditional_Enter
(S : V_I_Sema.A_Semaphore) RETURN Boolean;
PRAGMA Interface (Ada, Prio_Inherit_Conditional_Enter);
PRAGMA Interface_Name (Prio_Inherit_Conditional_Enter,
"PRIO_INHERIT_CONDITIONAL_ENTER");
PROCEDURE Prio_Inherit_Leave (S : V_I_Sema.A_Semaphore);
PRAGMA Interface (Ada, Prio_Inherit_Leave);
PRAGMA Interface_Name (Prio_Inherit_Leave, "PRIO_INHERIT_LEAVE");
-- This routine is called to get a semaphore but will not wait if
-- the semaphore is blocked.
-- The success or failure of the enter is returned as a boolean.
FUNCTION Conditional_Enter (S : V_I_Sema.A_Semaphore) RETURN Boolean IS
Result : Boolean;
BEGIN
IF Priority_Inheritance_Enabled THEN
RETURN Prio_Inherit_Conditional_Enter (S);
END IF;
V_Tas.Test_And_Set (S.Flag'Address, Result);
RETURN Result;
END Conditional_Enter;
PRAGMA Inline_Only (Conditional_Enter);
-- This routine is called to get a semaphore. It blocks until it
-- has it.
PROCEDURE Enter (S : V_I_Sema.A_Semaphore) IS
BEGIN
LOOP
EXIT WHEN Conditional_Enter (S);
Krn_Suspend (S);
END LOOP;
END Enter;
PRAGMA Inline_Only (Enter);
-- This routine is called upon exiting a semaphore region in user code.
PROCEDURE Leave (S : V_I_Sema.A_Semaphore) IS
BEGIN
IF Priority_Inheritance_Enabled THEN
Prio_Inherit_Leave (S);
RETURN;
END IF;
S.Flag := V_I_Types.Test_And_Set_False;
IF V_I_Types."=" (S.Others_Waiting, V_I_Types.Test_And_Set_True) THEN
Krn_Resume (S);
END IF;
END Leave;
PRAGMA Inline_Only (Leave);
END V_Sema;