#include "JLang/JMutex.hh"
#include <iostream>
#include <stdexcept>
#include <cstdlib>
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
Go to the source code of this file.
◆ withdraw()
Definition at line 16 of file JMutex.cc.
17{
19 throw std::runtime_error("Wrong amount!");
20
22 throw std::runtime_error("Your account can't provide the requested amount!");
23
25}
Template definition of a multi-dimensional oscillation probability interpolation table.
◆ deposit()
Definition at line 27 of file JMutex.cc.
28{
30 throw std::runtime_error("Wrong amount!");
31
33}
◆ main()
Definition at line 35 of file JMutex.cc.
36{
38
40
41 try {
42
43 JParser<> zap(
"Example program to test mutex messaging.");
44
46
48 }
49 catch(const exception &error) {
51 }
52
55
56 cout <<
"Trying to deposit 1000 eur\n";
57
58 {
61 }
62
63 cout <<
"Trying to put a negative amount\n";
64
65 try {
69 cout << e.what() <<
'\n';
70 }
71
72 cout <<
"Let the wife do shopping\n";
73
74 try {
77
79 cout <<
"Paying " <<
cost <<
"for something\n";
81 }
83 cout << e.what() <<
'\n';
84 }
85}
void withdraw(int &account, int amount)
void deposit(int &account, int amount)
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object