ReentrantSynchronizedException constructor
Exception thrown when a synchronized block is reentered from the same zone.
This exception is thrown when a synchronized block is entered from the same zone multiple times, which is not allowed.
Example
try {
synchronized(() {
// Do something
});
} catch (e) {
if (e is ReentrantSynchronizedException) {
print('Synchronized block reentered from the same zone');
}
}
Implementation
ReentrantSynchronizedException([String? message, Object? cause]) : super(
message ?? 'Synchronized block reentered from the same zone', cause: cause
);