-
Notifications
You must be signed in to change notification settings - Fork 786
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright The OpenTelemetry Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
namespace OpenTelemetry; | ||
|
||
/// <summary> | ||
/// Describes the concurrency mode of an OpenTelemetry extension. | ||
/// </summary> | ||
[Flags] | ||
public enum ConcurrencyModes : byte | ||
{ | ||
/* | ||
0 0 0 0 0 0 0 0 | ||
| | | | | | | | | ||
| | | | | | | +--- Reentrant | ||
| | | | | | +----- Multithreaded | ||
| | | | | +------- (reserved) | ||
| | | | +--------- (reserved) | ||
| | | +----------- (reserved) | ||
| | +------------- (reserved) | ||
| +--------------- (reserved) | ||
+----------------- Global | ||
*/ | ||
|
||
/// <summary> | ||
/// Reentrant, the component can be invoked recursively without resulting | ||
/// a deadlock or infinite loop. | ||
/// </summary> | ||
Reentrant = 0b1, | ||
|
||
/// <summary> | ||
/// Multithreaded, the component can be invoked concurrently across | ||
/// multiple threads. | ||
/// </summary> | ||
Multithreaded = 0b10, | ||
|
||
/// <summary> | ||
/// Global, when combined with other flags, indicates that a per-instance | ||
/// synchronization is insufficient, a global synchronization is required | ||
/// across all instances of the component. | ||
/// </summary> | ||
Global = 0b10000000, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright The OpenTelemetry Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
namespace OpenTelemetry; | ||
|
||
/// <summary> | ||
/// An attribute for declaring the supported <see cref="ConcurrencyModes"/> of an OpenTelemetry extension. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] | ||
public sealed class ConcurrencyModesAttribute : Attribute | ||
{ | ||
private readonly ConcurrencyModes supportedConcurrencyModes; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ConcurrencyModesAttribute"/> class. | ||
/// </summary> | ||
/// <param name="supported"><see cref="ConcurrencyModes"/>.</param> | ||
public ConcurrencyModesAttribute(ConcurrencyModes supported) | ||
{ | ||
this.supportedConcurrencyModes = supported; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the supported <see cref="ConcurrencyModes"/>. | ||
/// </summary> | ||
public ConcurrencyModes Supported => this.supportedConcurrencyModes; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters