Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

CCS/TM4C1290NCPDT: Should I keep Semaphore_Params and GateMutexPri_Params in scope after construction?

$
0
0

Part Number: TM4C1290NCPDT

Tool/software: Code Composer Studio

The title says it all: after I construct/create a lock object (semaphore or gate), do I have to keep the _Params object in scope? Or is the data from the _Params object copied to the lock object? Here's an example of what I mean:

```

Semaphore_Handle ConstructBinaryPrioritySemaphore(Semaphore_Struct &sem)
{
Semaphore_Params params;
Semaphore_Params_init(&params);
params.mode = Semaphore_Mode_BINARY_PRIORITY;

Semaphore_construct(&sem, 0, &params);
return Semaphore_handle(&sem);

}

```

Is the code above correct, or does params being destroyed at the end of the function cause problems?


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>