Skip to content

Commit c57f782

Browse files
allanrenuccicopybara-github
authored andcommitted
Migrate deprecated usages of tsl::WaitForNotificationWithTimeout.
PiperOrigin-RevId: 759562002
1 parent a4a801b commit c57f782

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

tsl/platform/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,6 +1144,7 @@ cc_library(
11441144
hdrs = ["notification.h"],
11451145
compatible_with = get_compatible_with_portable(),
11461146
deps = [
1147+
"@com_google_absl//absl/base:core_headers",
11471148
"@com_google_absl//absl/synchronization",
11481149
"@com_google_absl//absl/time",
11491150
],

tsl/platform/notification.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,21 @@ limitations under the License.
2121
#include <cstdint>
2222
#include <mutex> // NOLINT
2323

24+
#include "absl/base/macros.h"
2425
#include "absl/synchronization/notification.h"
2526
#include "absl/time/time.h"
2627

28+
// TODO: b/330223377 - This macro should eventually be provided by Abseil.
29+
#ifndef ABSL_DEPRECATE_AND_INLINE
30+
#define ABSL_DEPRECATE_AND_INLINE()
31+
#endif
32+
2733
namespace tsl {
2834

29-
using absl::Notification;
35+
using Notification ABSL_DEPRECATE_AND_INLINE() = absl::Notification;
3036

31-
// TODO(ddunleavy): remove this method and replace uses of `tsl::Notification`
32-
// with `absl::Notification`.
33-
inline bool WaitForNotificationWithTimeout(Notification* n,
37+
ABSL_DEPRECATE_AND_INLINE()
38+
inline bool WaitForNotificationWithTimeout(absl::Notification* n,
3439
int64_t timeout_in_us) {
3540
return n->WaitForNotificationWithTimeout(absl::Microseconds(timeout_in_us));
3641
}

0 commit comments

Comments
 (0)