Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 313040

Summary: update ISync interface enums should be changed to const
Product: [Technology] RTSC Reporter: Karl Wechsler <karl>
Component: RuntimeAssignee: Nitya Ramdas <nitya>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: d-russo
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: target:3.20

Description Karl Wechsler CLA 2010-05-16 14:08:12 EDT
I think we could do this in compatible way and should do this before 3.20 ...

The 'WaitStatus' enum is inconsistent with the return type of the wait function (Int).

I think that this:

    /*!
     *  ======== WaitStatus ========
     *  Error codes returned by Semaphore_pend
     */
    enum WaitStatus {
        WaitStatus_ERROR = -1,
        WaitStatus_TIMEOUT = 0,
        WaitStatus_SUCCESS = 1
    };

should be changed to this:

const Int ERROR = -1;
const Int TIMEOUT = 0;
const Int SUCCESS = 1;

I think this change would be compatible.  Note that we have a mis-mosh (sp?) of return codes in assorted implementations of ISync in the BIOS tree.   Some are returning direct value from Semaphore_pend (true/false).  Others are returning (0) and (1) (instead of the enums above).  It is all working out because success is (1) which matches TRUE but we should clean this up in ISync and the SyncSemaphore, etc. in xdc.runtime.knl.  And then clean it up in the BIOS code.

I think we could do this in compatible way and should do this before 3.20.
Comment 1 Karl Wechsler CLA 2010-05-16 14:12:31 EDT
Same is true for ISemaphore.xdc and Semaphore implementations in xdc.runtime.knl.

We need to tighten this up.
Comment 2 Dave Russo CLA 2010-05-19 17:55:50 EDT
Change will not be made in order to preserve backwards compatibility. Cdoc will be updated.
Comment 3 Dave Russo CLA 2010-05-19 17:56:22 EDT
Rejected