Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313040 - update ISync interface enums should be changed to const
Summary: update ISync interface enums should be changed to const
Status: CLOSED WONTFIX
Alias: None
Product: RTSC
Classification: Technology
Component: Runtime (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nitya Ramdas CLA
QA Contact:
URL:
Whiteboard: target:3.20
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-16 14:08 EDT by Karl Wechsler CLA
Modified: 2010-05-19 17:56 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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