Changes between Version 14 and Version 15 of library_locks


Ignore:
Timestamp:
Nov 27, 2015, 2:14:41 PM (9 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • library_locks

    v14 v15  
    1717
    1818 === unsigned int '''atomic_increment'''( unsigned int* shared, unsigned int increment) ===
    19 This blocking function uses a LL/SC to atomically increment a shared variable.
    20  * '''ptr''' : pointer on the shared variable
    21  * '''increment''' : increment value.
     19This blocking function uses a LL/SC to atomically increment a shared variable identified by the <ptr> pointer. The <increment> argument define the increment value. It can be a negative value.
    2220
    2321 == __Simple lock access functions__ ==
    2422
    2523 === '''void lock_init'''( user_lock_t * lock ) ===
    26 This function should be called by one single task.
    27  * '''lock''' : pointer on the user_lock_t structure.
     24This function initializes the lock identified by the <lock> pointer. It should be called by one single task.
    2825
    2926 === '''void lock_acquire'''( user_lock_t * lock ) ===
    30 This blocking function returns only when the lock has been successfully taken.
    31  * '''lock''' : pointer on the user_lock_t structure.
     27This blocking function returns only when the lock identified by the <lock> pointer has been successfully taken.
    3228
    3329 === '''void lock_release'''( user_lock_t * lock ) ===
    34 This function releases the lock. It must be called by a task after a successful lock_acquire().
    35  * '''lock''' : pointer on the user_lock_t structure.
     30This function releases the lock identified by he <lock> pointer. It must be called by a task after a successful lock_acquire().
    3631
    3732 == __Distributed lock access functions__ ==
     
    4439
    4540 === '''void sqt_lock_init'''( sqt_lock_t * lock , unsigned int x_size , unsigned int y_size , unsigned int nthreads ) ===
    46 This function should be called by one single thread. It allocates  both the distributed locks in each cluster (from the distributed heaps), and it initializes the sqt_lock_t variable (that must be allocated in the user application data segment).
    47  * '''lock''' : pointer on the sqt_lock_t structure.
    48  * '''x_size''' : number of clusters in a row.
    49  * '''x_size''' : number of clusters in a column.
    50  * '''nthreads''' : number of threads per cluster.
     41This function initializes the lock identified by the <lock> pointer. It should be called by one single thread. It allocates  both the distributed locks in each cluster (from the distributed heaps), and it initializes the sqt_lock_t variable (that must be allocated in the user application data segment).
     42The <x_size> and <y_size> arguments define the mesh size. The <nthreads> arguments define the number of threads per cluster.
    5143
    5244 === '''void sqt_lock_acquire'''( sqt_lock_t * lock ) ===
    53 This blocking function returns only when all locks of the distributed tree have been successfully taken.
    54  * '''lock''' : pointer on the sqt_lock_t structure.
     45This blocking function returns only when the distributed lock identified by the <lock> pointer has been successfully taken.
    5546
    5647 === '''void sqt_lock_release'''( sqt_lock_t * lock ) ===
    57 This function releases the lock. It must be called by a task after a successful lock_acquire().
    58  * '''lock''' : pointer on the sqt_lock_t structure.
     48This function releases the distributed lock identified by the <lock> pointer. It must be called by a task after a successful lock_acquire().