base: coding style
This commit is contained in:
parent
13a0c336d9
commit
394fce110e
|
@ -19,29 +19,26 @@
|
||||||
namespace Genode { class Lock; }
|
namespace Genode { class Lock; }
|
||||||
|
|
||||||
|
|
||||||
class Genode::Lock : public Cancelable_lock
|
struct Genode::Lock : Cancelable_lock
|
||||||
{
|
{
|
||||||
public:
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
|
explicit Lock(State initial = UNLOCKED) : Cancelable_lock(initial) { }
|
||||||
|
|
||||||
/**
|
void lock()
|
||||||
* Constructor
|
{
|
||||||
*/
|
while (1)
|
||||||
explicit Lock(State initial = UNLOCKED)
|
try {
|
||||||
: Cancelable_lock(initial) { }
|
Cancelable_lock::lock();
|
||||||
|
return;
|
||||||
|
} catch (Blocking_canceled) { }
|
||||||
|
}
|
||||||
|
|
||||||
void lock()
|
/**
|
||||||
{
|
* Lock guard
|
||||||
while (1)
|
*/
|
||||||
try {
|
typedef Lock_guard<Lock> Guard;
|
||||||
Cancelable_lock::lock();
|
|
||||||
return;
|
|
||||||
} catch (Blocking_canceled) { }
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Lock guard
|
|
||||||
*/
|
|
||||||
typedef Lock_guard<Lock> Guard;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _INCLUDE__BASE__LOCK_H_ */
|
#endif /* _INCLUDE__BASE__LOCK_H_ */
|
||||||
|
|
Loading…
Reference in New Issue