Software locks issue

If you have a simple question and just want an answer.
jpe
Junior Member
Posts: 4
Joined: Thu May 28, 2015 1:15 pm

Software locks issue

Post by jpe »

The application consists of two tasks running on a two separate cores. There is also a C library, which has some shared data defined and some functions which operate on those structures. Both tasks call those functions in a loop. The C library was designed thread-wise, so it implements some dummy functions for mutex locking/unlocking (so the shared resources are never written simultaneously by both tasks). So we are writing a wrapper for XC software locks using lib_locks 2.0.0.

The whole implementation of a wrapper is quite trivial, however, it seems that the tasks cannot release the locks, and the whole application freezes when both tasks are waiting in an loop of swlock_acquire(). When tried to implement a hardware lock, the SIGBUS signal is being received at the moment of releasing a lock.

The question is: what is wrong? Are there any examples of an application with two tasks and locks?
You do not have the required permissions to view the files attached to this post.
srinie
XCore Addict
Posts: 158
Joined: Thu Mar 20, 2014 8:04 am

Post by srinie »

An example program @

https://github.com/xcore/sc_util/tree/m ... ks_example

Using lib_locks should not ve a major impact to use with the above example.