Skip to content

Commit

Permalink
- Adjusted doc on thread_naming_pattern; only "c" and "l" are valid (h…
Browse files Browse the repository at this point in the history
  • Loading branch information
belaban committed Dec 18, 2024
1 parent 6f4b363 commit 0857708
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
13 changes: 4 additions & 9 deletions src/org/jgroups/protocols/TP.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,15 @@ public abstract class TP extends Protocol implements DiagnosticsHandler.ProbeHan
@Property(description="If true, create virtual threads, otherwise create native threads")
protected boolean use_vthreads;

@Property(description="Thread naming pattern for threads in this channel. Valid values are \"pcl\": " +
"\"p\": includes the thread name, e.g. \"Incoming thread-1\", \"UDP ucast receiver\", " +
@Property(description="Thread naming pattern for threads in this channel. Valid values are \"cl\": " +
"\"c\": includes the cluster name, e.g. \"MyCluster\", " +
"\"l\": includes the local address of the current member, e.g. \"192.168.5.1:5678\"")
"\"l\": includes the local address of the current member, e.g. \"A\"")
protected String thread_naming_pattern="cl";


@Property(description="Interval (in ms) at which the time service updates its timestamp. 0 disables the time service",
type=AttributeType.TIME)
protected long time_service_interval=500;


/** Whether warnings about messages from different groups are logged - private flag, not for common use */
@Property(description="whether or not warnings about messages from different groups are logged")
protected boolean log_discard_msgs=true;
Expand Down Expand Up @@ -623,8 +620,7 @@ public SocketFactory getSocketFactory() {
}

/**
* Names the current thread. Valid values are "pcl":
* p: include the previous (original) name, e.g. "Incoming thread-1", "UDP ucast receiver"
* Names the current thread. Valid values are "cl":
* c: include the cluster name, e.g. "MyCluster"
* l: include the local address of the current member, e.g. "192.168.5.1:5678"
*/
Expand Down Expand Up @@ -1478,8 +1474,7 @@ protected void unsetThreadNames() {
}

protected void setInAllThreadFactories(String cluster_name, Address local_address, String pattern) {
ThreadFactory[] factories= {thread_factory};

ThreadFactory[] factories={thread_factory};
for(ThreadFactory factory: factories) {
if(pattern != null)
factory.setPattern(pattern);
Expand Down
8 changes: 2 additions & 6 deletions src/org/jgroups/util/DefaultThreadFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,8 @@ protected String getThreadName(String base_name, final Thread thread, String add
if(addr == null)
addr=this.address;

if(!includeClusterName && !includeLocalAddress && cluster_name != null) {
sb.append(",shared=").append(cluster_name);
if(!includeClusterName && !includeLocalAddress)
return sb.toString();
}

if(includeClusterName)
sb.append(',').append(cluster_name);
Expand Down Expand Up @@ -150,10 +148,8 @@ protected String getNewThreadName(String base_name, String addr, String cluster_
if(addr == null)
addr=this.address;

if(!includeClusterName && !includeLocalAddress && cluster_name != null) {
sb.append(",shared=").append(cluster_name);
if(!includeClusterName && !includeLocalAddress)
return sb.toString();
}

if(includeClusterName)
sb.append(',').append(cluster_name);
Expand Down

0 comments on commit 0857708

Please sign in to comment.