Java tutorial
//package com.java2s; public class Main { public synchronized static Long getCurrentThreadID() { return (Long) Thread.currentThread().getId(); } }