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

Bug 317081

Summary: Sync module needs a wait forever constant
Product: [Technology] RTSC Reporter: Ramsey Harris <ramsey>
Component: RuntimeAssignee: Sasha Slijepcevic <sascha>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: amitm, d-russo
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: target:3.20.02

Description Ramsey Harris CLA 2010-06-16 13:50:40 EDT
The Sync_wait() function has a timeout parameter. But there is no constant, such as Sync_WAIT_FOREVER, which makes the function wait until the object has been signaled. Right now, I need to use the constant from the created object. For example, SyncSemThread_WAIT_FOREVER, but this defeats the purpose of using a generic front-end such as Sync.
Comment 1 Dave Russo CLA 2010-06-22 19:34:21 EDT
Change needs to be made in a binary compatible way. Need to check dependency in osal and avala trees.
Comment 2 Sasha Slijepcevic CLA 2010-07-14 14:23:17 EDT
SyncSemThread inherits ISync, which defines ISync_WAIT_FOREVER. Therefore, SyncSemThread_WAIT_FOREVER is equivalent to ISync_WAIT_FOREVER, and each usage of SyncSemThread_WAIT_FOREVER can be replaced with ISync_WAIT_FOREVER.
Sync does not inherit from ISync, so we could add Sync_WAIT_FOREVER without a conflict in Sync's namespace, but that doesn't seem to be needed.
Comment 3 Sasha Slijepcevic CLA 2010-07-15 19:20:23 EDT
In xdc-v43, Sync.xdc now contains:

    /*! Used to wait forever */
    const UInt WAIT_FOREVER = ISync.WAIT_FOREVER;

    /*! Used to specify no waiting */
    const UInt NO_WAIT = ISync.NO_WAIT;

The result of this addition is the following constant in Sync.h:
#define xdc_runtime_knl_Sync_WAIT_FOREVER (~(0))

Since, it's just a #define, a package using that constant in its target code will be binary compatible with earlier version of that same package.

If there is a reference to Sync.WAIT_FOREVER in a package's config code, the build will fail against XDCtools 3.20.
Comment 4 Amit Mookerjee CLA 2010-08-05 17:19:50 EDT
Verified by inspection in xdc-v43
Comment 5 Dave Russo CLA 2011-06-20 14:42:20 EDT
Shipped in XDCtools 3.20.02