Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #642, 645, 701, 702, 703 - OSAL global table management #704

Merged
merged 5 commits into from
Jan 11, 2021

Commits on Dec 21, 2020

  1. Fix nasa#702, use iterators instead of for loops

    Convert remaining operations using for loops to use iterators.
    This ensures locking is done consistently and correctly.
    jphickey committed Dec 21, 2020
    Configuration menu
    Copy the full SHA
    ce8e85c View commit details
    Browse the repository at this point in the history

Commits on Dec 22, 2020

  1. Fix nasa#645, implement separate lock/unlock key

    Implement an "unlock key" - based on task ID - which can be part of the local
    token, rather than relying on the task ID being the same between the lock
    and unlock ops.  Notably, the task ID can change, in particular if the task
    is exiting.
    
    Also Fixes nasa#701, other general cleanup
    
    Implement all global lock/unlock error checking in shared layer, not in
    impl layer, for consistency.  Remove redundant checks.
    
    Make all functions return void (should never fail) and in the
    unlikely event that something does fail then report the error,
    but no other recourse possible.
    jphickey committed Dec 22, 2020
    Configuration menu
    Copy the full SHA
    29e1fd5 View commit details
    Browse the repository at this point in the history
  2. Fix nasa#703, implement exclusive/reserved lock

    Change the EXCLUSIVE lock type such that it sets the ID in the global
    table to RESERVED and unlocks the global before returning to the caller.
    
    This allows the potentially long-running operation to complete and
    not block other operations from happening in other tasks.
    
    Use the EXCLUSIVE lock for all create/delete ops as well as for
    bind and connect socket ops.
    
    Also implement a new "RESERVED" lock to handle a special case in the
    vxworks timebase implementation where the impl layer needs to acquire
    a token for an object as it is being created.  This case is special
    because it needs to happen during OS_TimeBaseCreate, and cannot be
    completed after the fact like normal tasks, because it is a factor
    in determining the success/fail status of the overall operation.
    jphickey committed Dec 22, 2020
    Configuration menu
    Copy the full SHA
    a7529cf View commit details
    Browse the repository at this point in the history
  3. Fix nasa#642, make OS_TaskDelete synchronous

    In the POSIX implementation, OS_TaskDelete was implemented in a
    deferred manner - the API call was a request, and the actual
    deletion occured sometime thereafter.  This is a problem if the
    task is running code within a dynamically loaded module, and the
    intent is to delete the task so the module can be unloaded.  In
    this case the app needs to be certain that the task has actually
    been deleted before unloading can be done safely.
    
    To do this requires use of pthread_join() on POSIX which confirms
    that the task has exited.  However, this is a (potentially) blocking
    call, so to do this requires rework of the EXCLUSIVE lock mode
    such that the OSAL lock is _not_ held during the join operation.
    jphickey committed Dec 22, 2020
    Configuration menu
    Copy the full SHA
    7ba42a6 View commit details
    Browse the repository at this point in the history
  4. Fix nasa#703, unit test updates

    Update unit tests for idmap functions, add test cases where coverage
    was incomplete.  All OS_ObjectId* function coverage is back at 100%.
    jphickey committed Dec 22, 2020
    Configuration menu
    Copy the full SHA
    c821c37 View commit details
    Browse the repository at this point in the history