Versions Compared

Key

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

...

Compliant Solution

This solution solution uses a mutex to make credits and debits atomic operations. All credits and debits will now affect the account balance, so an attacker cannot exploit the race condition to steal money from the bank. The mutex is created with the pthread_mutex function. In addition, the volatile keyword is used so prefetching does not occur (see DCL34-C. Use volatile for data that cannot be cached).

...