Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#ccccff
#include <pthread.h>

  volatile int account_balance;
  pthread_mutex_t flag  = PTHREAD_MUTEX_INITIALIZER;

  void debit(int amount) {
   pthread_mutex_lock(&flag);
   account_balance -= amount;//Inside critical section
   pthread_mutex_unlock(&flag);
 }

Risk Assessment

Recommendation

Severity

Likelihood

Remediation Cost

Priority

Level

POS40-C

Medium

Probable

Medium

P12

L1

...