CheckThread.org (Beta)

@ThreadSafe Annotation

Description

Place this annotation on methods that can safely be called from more than one thread concurrently. The method implementer must ensure thread safety using a variety of possible techniques including immutable data, synchronized shared data, or not using any shared data at all.

Location

  • Method
  • Class

Annotation Parameters

  • suppressErrors=true/false
    Suppress any errors reported by CheckThread.
    Example: @ThreadSafe(suppressErrors=true)

Validation Performed by CheckThread

  • Error if shared data within method scope is undergoing read and write operations without synchronization
  • Error if method is invoking a @ThreadConfined method
  • Error if method is invoking a @NotThreadSafe method without synchronization
©2009 CheckThread