Skip to content

Commit

Permalink
removed synchronization in logging that causes deadlocks in high-perf…
Browse files Browse the repository at this point in the history
…ormance environments

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6044 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Jun 10, 2009
1 parent db3a06d commit 398e210
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion source/de/anomic/yacy/logging/ConsoleOutErrHandler.java
Expand Up @@ -150,7 +150,7 @@ public void close() throws SecurityException {
this.stdErrHandler.close();
}

public synchronized void setLevel(final Level newLevel) throws SecurityException {
public void setLevel(final Level newLevel) throws SecurityException {
super.setLevel(newLevel);
}

Expand Down
6 changes: 3 additions & 3 deletions source/de/anomic/yacy/logging/ConsoleOutHandler.java
Expand Up @@ -30,20 +30,20 @@
import java.util.logging.SimpleFormatter;
import java.util.logging.StreamHandler;

public final class ConsoleOutHandler extends StreamHandler{
public final class ConsoleOutHandler extends StreamHandler {

public ConsoleOutHandler() {
setLevel(Level.FINEST);
setFormatter(new SimpleFormatter());
setOutputStream(System.out);
}

public synchronized void publish(final LogRecord record) {
public void publish(final LogRecord record) {
super.publish(record);
flush();
}

public synchronized void close() {
public void close() {
flush();
}
}
2 changes: 1 addition & 1 deletion source/de/anomic/yacy/logging/GuiHandler.java
Expand Up @@ -116,7 +116,7 @@ public int getSize() {
return this.size;
}

public synchronized void publish(final LogRecord record) {
public void publish(final LogRecord record) {
if (!isLoggable(record)) return;

// write it to the buffer
Expand Down
4 changes: 1 addition & 3 deletions source/de/anomic/yacy/logging/MiniLogFormatter.java
Expand Up @@ -36,17 +36,15 @@ public MiniLogFormatter() {
super();
}

public synchronized String format(final LogRecord record) {
public String format(final LogRecord record) {

final StringBuilder buffer = this.buffer;
buffer.setLength(0);

buffer.append(formatMessage(record));

// adding the stack trace if available
buffer.append(System.getProperty("line.separator"));


return buffer.toString();
}
}
2 changes: 1 addition & 1 deletion source/de/anomic/yacy/logging/SimpleLogFormatter.java
Expand Up @@ -51,7 +51,7 @@ public SimpleLogFormatter() {
super();
}

public synchronized String format(final LogRecord record) {
public String format(final LogRecord record) {

final StringBuffer buffer = this.buffer;
buffer.setLength(0);
Expand Down

0 comments on commit 398e210

Please sign in to comment.