Skip to content

Commit a554fc6

Browse files
suopytorchmergebot
authored andcommitted
Revert D34645509: [PyTorch] Update Synchronized<T>::withLock() to return the type/value from the aceepted callable
Test Plan: revert-hammer Differential Revision: D34645509 (pytorch@de4a87f) Original commit changeset: 9a4bd5d1d78a Original Phabricator Diff: D34645509 (pytorch@de4a87f) fbshipit-source-id: 3a1737cda866085fc0dec9997d0ce659f636a0c2 (cherry picked from commit 46d3300)
1 parent b65adf8 commit a554fc6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

c10/util/Synchronized.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ class Synchronized final {
4242
* provided callback safely.
4343
*/
4444
template <typename CB>
45-
typename std::result_of<CB(T&)>::type withLock(CB cb) {
45+
void withLock(CB cb) {
4646
std::lock_guard<std::mutex> guard(this->mutex_);
47-
return cb(this->data_);
47+
cb(this->data_);
4848
}
4949

5050
/**
@@ -53,9 +53,9 @@ class Synchronized final {
5353
* the provided callback safely.
5454
*/
5555
template <typename CB>
56-
typename std::result_of<CB(T const&)>::type withLock(CB cb) const {
56+
void withLock(CB cb) const {
5757
std::lock_guard<std::mutex> guard(this->mutex_);
58-
return cb(this->data_);
58+
cb(this->data_);
5959
}
6060
};
6161
} // end namespace c10

0 commit comments

Comments
 (0)